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

Collects and publishes Master metrics. More...

#include <MetricsHandler.h>

Inheritance diagram for Hypertable::MetricsHandler:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::MetricsHandler:
Collaboration graph
[legend]

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

Commm_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...
 
Cronologm_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
propsProperties object

Definition at line 42 of file MetricsHandler.cc.

virtual Hypertable::MetricsHandler::~MetricsHandler ( )
inlinevirtual

Destructor.

Cancels the timer.

Definition at line 60 of file MetricsHandler.h.

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.

Parameters
propsProperties object
slow_query_logSlow query log

Definition at line 43 of file MetricsHandler.cc.

virtual Hypertable::MetricsHandler::~MetricsHandler ( )
inlinevirtual

Destructor.

Cancels the timer.

Definition at line 70 of file MetricsHandler.h.

Member Function Documentation

void Hypertable::MetricsHandler::connection_decrement ( )
inline

Decrements connection count.

Decrements active connection count.

Definition at line 107 of file MetricsHandler.h.

void Hypertable::MetricsHandler::connection_increment ( )
inline

Increments connection count.

Increments active connection count.

Definition at line 101 of file MetricsHandler.h.

void Hypertable::MetricsHandler::error_increment ( )
inline

Increments error count.

Increments error count which is used in computing errors/s.

Definition at line 95 of file MetricsHandler.h.

void MetricsHandler::handle ( Hypertable::EventPtr event)
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.

Parameters
eventComm layer timer event

Implements Hypertable::DispatchHandler.

Definition at line 65 of file MetricsHandler.cc.

virtual void Hypertable::MetricsHandler::handle ( EventPtr event)
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.

Parameters
eventComm layer timer event

Implements Hypertable::DispatchHandler.

void Hypertable::MetricsHandler::operation_increment ( )
inline

Increments operation count.

Increments operation count which is used in computing operations/s.

Definition at line 78 of file MetricsHandler.h.

void Hypertable::MetricsHandler::request_increment ( )
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.

Member Data Documentation

atomic<int32_t> Hypertable::MetricsHandler::m_active_connections {0}
private

Active ThriftBroker connections.

Definition at line 138 of file MetricsHandler.h.

int32_t Hypertable::MetricsHandler::m_collection_interval {}
private

Metrics collection interval

Definition at line 97 of file MetricsHandler.h.

Comm * Hypertable::MetricsHandler::m_comm {}
private

Comm layer.

Definition at line 85 of file MetricsHandler.h.

interval_metric<int64_t> Hypertable::MetricsHandler::m_errors {}
private

ThriftBroker errors

Definition at line 135 of file MetricsHandler.h.

MetricsCollectorGangliaPtr Hypertable::MetricsHandler::m_ganglia_collector
private

Ganglia metrics collector.

Definition at line 88 of file MetricsHandler.h.

int64_t Hypertable::MetricsHandler::m_last_timestamp
private

Timestamp of last metrics collection

Definition at line 94 of file MetricsHandler.h.

MetricsProcess Hypertable::MetricsHandler::m_metrics_process
private

General process metrics tracker.

Definition at line 91 of file MetricsHandler.h.

interval_metric<int64_t> Hypertable::MetricsHandler::m_operations {}
private

Master operations

Definition at line 100 of file MetricsHandler.h.

interval_metric<int64_t> Hypertable::MetricsHandler::m_requests {}
private

ThriftBroker requests

Definition at line 132 of file MetricsHandler.h.

Cronolog* Hypertable::MetricsHandler::m_slow_query_log {}
private

Slow query log.

Definition at line 123 of file MetricsHandler.h.

bool Hypertable::MetricsHandler::m_started {}
private

Collection has started.

Definition at line 103 of file MetricsHandler.h.


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