Computes application load statistics. More...
#include <LoadStatistics.h>
Classes | |
struct | Bundle |
POD-style structure to hold statistics. More... | |
Public Member Functions | |
LoadStatistics (int64_t compute_period) | |
Constructor. More... | |
void | lock () |
Locks m_mutex. More... | |
void | unlock () |
Unlocks m_mutex. More... | |
void | add_scan_data (uint32_t count, uint32_t cells_scanned, uint32_t cells_returned, uint64_t bytes_scanned, uint64_t bytes_returned) |
Adds scan data to m_running statistics bundle. More... | |
void | add_cached_scan_data (uint32_t count, uint32_t cached_cells_returned, uint64_t cached_bytes_returned) |
Adds cached scan data to m_running statistics bundle. More... | |
void | add_update_data (uint32_t count, uint32_t cells, uint64_t total_bytes, uint32_t syncs) |
Adds scan data to m_running statistics bundle. More... | |
void | increment_compactions_major () |
void | increment_compactions_minor () |
void | increment_compactions_merging () |
void | increment_compactions_gc () |
void | recompute (Bundle *stats=0) |
Recomputes statistics. More... | |
void | get (Bundle *stats) |
Gets statistics for last completed time period. More... | |
Public Attributes | |
std::mutex | m_mutex |
Mutex for serializing concurrent access More... | |
int64_t | m_compute_period |
std::chrono::steady_clock::time_point | m_start_time |
Bundle | m_running |
Bundle | m_computed |
Computes application load statistics.
This class is used to compute application load statistics including scans, updates and syncs. It is initialized with a time period over which the statistics are periodically gathered. The statistics for the most recent completed period are stored in the m_computed member, while the statistics being gathered for the current time period are stored in the m_running member.
Definition at line 52 of file LoadStatistics.h.
|
inline |
Constructor.
Records start time of current period in m_start_time and clears the m_running and m_computed statistics bundles.
compute_period | Time period over which statistics are gathered |
Definition at line 96 of file LoadStatistics.h.
|
inline |
Adds cached scan data to m_running statistics bundle.
count | Scan count |
cached_cells_returned | Count of cached cells returned |
cached_bytes_returned | Count of cached bytes returned |
Definition at line 132 of file LoadStatistics.h.
|
inline |
Adds scan data to m_running statistics bundle.
count | Scan count |
cells_scanned | Count of cells scanned |
cells_returned | Count of cells returned |
bytes_scanned | Count of bytes scanned |
bytes_returned | Count of bytes returned |
Definition at line 116 of file LoadStatistics.h.
|
inline |
Adds scan data to m_running statistics bundle.
count | Update count |
cells | Count of cells updated |
total_bytes | Count of bytes updated |
syncs | Sync count |
Definition at line 146 of file LoadStatistics.h.
|
inline |
Gets statistics for last completed time period.
stats | Pointer to structure to hold statistics |
Definition at line 220 of file LoadStatistics.h.
|
inline |
Definition at line 168 of file LoadStatistics.h.
|
inline |
Definition at line 153 of file LoadStatistics.h.
|
inline |
Definition at line 163 of file LoadStatistics.h.
|
inline |
Definition at line 158 of file LoadStatistics.h.
|
inline |
Locks m_mutex.
Definition at line 103 of file LoadStatistics.h.
|
inline |
Recomputes statistics.
This method first checks to see if m_compute_period milliseconds have elapsed since the statistics were last computed and if so, it copies m_running to m_computed, computes and sets the period_millis
, scan_mbps
, and update_mbps
members of m_computed, clears m_running, and sets m_start_time to the current time. Otherwise, statistics recomputation is skipped. If stats
is not NULL, then the m_computed member will be copied to it.
stats | Output parameter to hold copy of last computed statistics |
Definition at line 184 of file LoadStatistics.h.
|
inline |
Unlocks m_mutex.
Definition at line 106 of file LoadStatistics.h.
int64_t Hypertable::LoadStatistics::m_compute_period |
Definition at line 229 of file LoadStatistics.h.
Bundle Hypertable::LoadStatistics::m_computed |
Definition at line 238 of file LoadStatistics.h.
std::mutex Hypertable::LoadStatistics::m_mutex |
Mutex for serializing concurrent access
Definition at line 226 of file LoadStatistics.h.
Bundle Hypertable::LoadStatistics::m_running |
Definition at line 235 of file LoadStatistics.h.
std::chrono::steady_clock::time_point Hypertable::LoadStatistics::m_start_time |
Definition at line 232 of file LoadStatistics.h.