Collects and publishes Master metrics. More...
#include <MetricsHandler.h>
Public Member Functions | |
MetricsHandler (PropertiesPtr &props) | |
Constructor. More... | |
virtual | ~MetricsHandler () |
Destructor. More... | |
void | start_collecting () |
Starts metrics collection. More... | |
void | stop_collecting () |
Stops metrics collection. More... | |
virtual void | handle (EventPtr &event) |
Collects and publishes metrics. More... | |
void | operation_increment () |
Increments operation count. More... | |
MetricsHandler (PropertiesPtr &props, Cronolog *slow_query_log) | |
Constructor. More... | |
virtual | ~MetricsHandler () |
Destructor. More... | |
void | start_collecting () |
Starts metrics collection. More... | |
void | stop_collecting () |
Stops metrics collection. More... | |
virtual void | handle (EventPtr &event) |
Collects and publishes metrics. More... | |
void | request_increment () |
Increments request count. More... | |
void | error_increment () |
Increments error count. More... | |
void | connection_increment () |
Increments connection count. More... | |
void | connection_decrement () |
Decrements connection count. More... | |
Public Member Functions inherited from Hypertable::DispatchHandler | |
virtual | ~DispatchHandler () |
Destructor. More... | |
Private Attributes | |
Comm * | m_comm {} |
Comm layer. More... | |
MetricsCollectorGangliaPtr | m_ganglia_collector |
Ganglia metrics collector. More... | |
MetricsProcess | m_metrics_process |
General process metrics tracker. More... | |
int64_t | m_last_timestamp |
Timestamp of last metrics collection More... | |
int32_t | m_collection_interval {} |
Metrics collection interval More... | |
interval_metric< int64_t > | m_operations {} |
Master operations More... | |
bool | m_started {} |
Collection has started. More... | |
Cronolog * | m_slow_query_log {} |
Slow query log. More... | |
interval_metric< int64_t > | m_requests {} |
ThriftBroker requests More... | |
interval_metric< int64_t > | m_errors {} |
ThriftBroker errors More... | |
atomic< int32_t > | m_active_connections {0} |
Active ThriftBroker connections. More... | |
Collects and publishes Master metrics.
Collects and publishes ThriftBroker metrics.
This class acts as the metrics timer dispatch handler
This class acts as the timer dispatch handler for periodic metrics collection for the ThriftBroker.
Definition at line 48 of file MetricsHandler.h.
MetricsHandler::MetricsHandler | ( | PropertiesPtr & | props | ) |
Constructor.
Initializes state, setting m_collection_interval to the property Hypertable.Monitoring.Interval
and starts a timer using this object as the handler.
props | Properties object |
Definition at line 42 of file MetricsHandler.cc.
|
inlinevirtual |
MetricsHandler::MetricsHandler | ( | PropertiesPtr & | props, |
Cronolog * | slow_query_log | ||
) |
Constructor.
Initializes m_collection_interval to the property Hypertable.Monitoring.Interval
and allocates a Ganglia collector object, initializing it with "thriftbroker" and Hypertable.Metrics.Ganglia.Port
. Lastly, calls Comm::set_timer() to register a timer for m_collection_interval milliseconds in the future and passes this
as the timer handler.
props | Properties object |
slow_query_log | Slow query log |
Definition at line 43 of file MetricsHandler.cc.
|
inlinevirtual |
|
inline |
Decrements connection count.
Decrements active connection count.
Definition at line 107 of file MetricsHandler.h.
|
inline |
Increments connection count.
Increments active connection count.
Definition at line 101 of file MetricsHandler.h.
|
inline |
Increments error count.
Increments error count which is used in computing errors/s.
Definition at line 95 of file MetricsHandler.h.
|
virtual |
Collects and publishes metrics.
This method computes and updates the operations/s
and general process metrics and publishes them via m_ganglia_collector. After metrics have been collected, the timer is re-registered for m_collection_interval milliseconds in the future.
event | Comm layer timer event |
Implements Hypertable::DispatchHandler.
Definition at line 65 of file MetricsHandler.cc.
|
virtual |
Collects and publishes metrics.
This method computes and updates the requests/s, errors, connections, and general process metrics and publishes them via m_ganglia_collector. After metrics have been collected, if #m_slow_query_log is not null, then it is synced and the timer is re-registered for m_collection_interval milliseconds in the future.
event | Comm layer timer event |
Implements Hypertable::DispatchHandler.
|
inline |
Increments operation count.
Increments operation count which is used in computing operations/s.
Definition at line 78 of file MetricsHandler.h.
|
inline |
Increments request count.
Increments request count which is used in computing requests/s.
Definition at line 89 of file MetricsHandler.h.
void MetricsHandler::start_collecting | ( | ) |
Starts metrics collection.
Definition at line 49 of file MetricsHandler.cc.
void Hypertable::MetricsHandler::start_collecting | ( | ) |
Starts metrics collection.
void MetricsHandler::stop_collecting | ( | ) |
Stops metrics collection.
Definition at line 58 of file MetricsHandler.cc.
void Hypertable::MetricsHandler::stop_collecting | ( | ) |
Stops metrics collection.
|
private |
Active ThriftBroker connections.
Definition at line 138 of file MetricsHandler.h.
|
private |
Metrics collection interval
Definition at line 97 of file MetricsHandler.h.
|
private |
Comm layer.
Definition at line 85 of file MetricsHandler.h.
|
private |
ThriftBroker errors
Definition at line 135 of file MetricsHandler.h.
|
private |
Ganglia metrics collector.
Definition at line 88 of file MetricsHandler.h.
|
private |
Timestamp of last metrics collection
Definition at line 94 of file MetricsHandler.h.
|
private |
General process metrics tracker.
Definition at line 91 of file MetricsHandler.h.
|
private |
Master operations
Definition at line 100 of file MetricsHandler.h.
|
private |
ThriftBroker requests
Definition at line 132 of file MetricsHandler.h.
|
private |
Slow query log.
Definition at line 123 of file MetricsHandler.h.
|
private |
Collection has started.
Definition at line 103 of file MetricsHandler.h.