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
Hyperspace::MetricsHandler Class Reference

Collects and publishes Hyperspace metrics. More...

#include <MetricsHandler.h>

Inheritance diagram for Hyperspace::MetricsHandler:
Inheritance graph
[legend]
Collaboration diagram for Hyperspace::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 request_increment ()
 Increments request 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_requests {}
 Hyperspace requests More...
 

Detailed Description

Collects and publishes Hyperspace metrics.

This class acts as the timer dispatch handler for periodic metrics collection for Hyperspace.

Definition at line 51 of file MetricsHandler.h.

Constructor & Destructor Documentation

MetricsHandler::MetricsHandler ( PropertiesPtr props)

Constructor.

Initializes m_collection_interval to the property Hypertable.Monitoring.Interval and allocates a Ganglia collector object, initializing it with "hyperspace" 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

Definition at line 44 of file MetricsHandler.cc.

MetricsHandler::~MetricsHandler ( )
virtual

Destructor.

Cancels the timer.

Definition at line 51 of file MetricsHandler.cc.

Member Function Documentation

void MetricsHandler::handle ( Hypertable::EventPtr event)
virtual

Collects and publishes metrics.

This method updates the requests/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 66 of file MetricsHandler.cc.

void Hyperspace::MetricsHandler::request_increment ( )
inline

Increments request count.

Increments m_requests which is used in computing requests/s.

Definition at line 85 of file MetricsHandler.h.

void MetricsHandler::start_collecting ( )

Starts metrics collection.

Definition at line 54 of file MetricsHandler.cc.

void MetricsHandler::stop_collecting ( )

Stops metrics collection.

Definition at line 60 of file MetricsHandler.cc.

Member Data Documentation

int32_t Hyperspace::MetricsHandler::m_collection_interval {}
private

Metrics collection interval

Definition at line 104 of file MetricsHandler.h.

Comm* Hyperspace::MetricsHandler::m_comm
private

Comm layer.

Definition at line 92 of file MetricsHandler.h.

MetricsCollectorGangliaPtr Hyperspace::MetricsHandler::m_ganglia_collector
private

Ganglia metrics collector.

Definition at line 95 of file MetricsHandler.h.

int64_t Hyperspace::MetricsHandler::m_last_timestamp
private

Timestamp of last metrics collection

Definition at line 101 of file MetricsHandler.h.

MetricsProcess Hyperspace::MetricsHandler::m_metrics_process
private

General process metrics tracker.

Definition at line 98 of file MetricsHandler.h.

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

Hyperspace requests

Definition at line 107 of file MetricsHandler.h.


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