0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Public Attributes | List of all members
Hypertable::LoadStatistics Class Reference

Computes application load statistics. More...

#include <LoadStatistics.h>

Collaboration diagram for Hypertable::LoadStatistics:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

Hypertable::LoadStatistics::LoadStatistics ( int64_t  compute_period)
inline

Constructor.

Records start time of current period in m_start_time and clears the m_running and m_computed statistics bundles.

Parameters
compute_periodTime period over which statistics are gathered

Definition at line 96 of file LoadStatistics.h.

Member Function Documentation

void Hypertable::LoadStatistics::add_cached_scan_data ( uint32_t  count,
uint32_t  cached_cells_returned,
uint64_t  cached_bytes_returned 
)
inline

Adds cached scan data to m_running statistics bundle.

Parameters
countScan count
cached_cells_returnedCount of cached cells returned
cached_bytes_returnedCount of cached bytes returned
Warning
This method must be called with m_mutex locked

Definition at line 132 of file LoadStatistics.h.

void Hypertable::LoadStatistics::add_scan_data ( uint32_t  count,
uint32_t  cells_scanned,
uint32_t  cells_returned,
uint64_t  bytes_scanned,
uint64_t  bytes_returned 
)
inline

Adds scan data to m_running statistics bundle.

Parameters
countScan count
cells_scannedCount of cells scanned
cells_returnedCount of cells returned
bytes_scannedCount of bytes scanned
bytes_returnedCount of bytes returned
Warning
This method must be called with m_mutex locked

Definition at line 116 of file LoadStatistics.h.

void Hypertable::LoadStatistics::add_update_data ( uint32_t  count,
uint32_t  cells,
uint64_t  total_bytes,
uint32_t  syncs 
)
inline

Adds scan data to m_running statistics bundle.

Parameters
countUpdate count
cellsCount of cells updated
total_bytesCount of bytes updated
syncsSync count
Warning
This method must be called with m_mutex locked

Definition at line 146 of file LoadStatistics.h.

void Hypertable::LoadStatistics::get ( Bundle stats)
inline

Gets statistics for last completed time period.

Parameters
statsPointer to structure to hold statistics

Definition at line 220 of file LoadStatistics.h.

void Hypertable::LoadStatistics::increment_compactions_gc ( )
inline

Definition at line 168 of file LoadStatistics.h.

void Hypertable::LoadStatistics::increment_compactions_major ( )
inline

Definition at line 153 of file LoadStatistics.h.

void Hypertable::LoadStatistics::increment_compactions_merging ( )
inline

Definition at line 163 of file LoadStatistics.h.

void Hypertable::LoadStatistics::increment_compactions_minor ( )
inline

Definition at line 158 of file LoadStatistics.h.

void Hypertable::LoadStatistics::lock ( )
inline

Locks m_mutex.

Definition at line 103 of file LoadStatistics.h.

void Hypertable::LoadStatistics::recompute ( Bundle stats = 0)
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.

Parameters
statsOutput parameter to hold copy of last computed statistics

Definition at line 184 of file LoadStatistics.h.

void Hypertable::LoadStatistics::unlock ( )
inline

Unlocks m_mutex.

Definition at line 106 of file LoadStatistics.h.

Member Data Documentation

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.


The documentation for this class was generated from the following file: