27 #ifndef FsBroker_Lib_MetricsHandler_h
28 #define FsBroker_Lib_MetricsHandler_h
36 #include <Common/metrics>
88 std::lock_guard<std::mutex> lock(
m_mutex);
96 std::lock_guard<std::mutex> lock(
m_mutex);
105 std::lock_guard<std::mutex> lock(
m_mutex);
113 std::lock_guard<std::mutex> lock(
m_mutex);
163 #endif // FsBroker_Lib_MetricsHandler_h
int32_t m_syncs
Syncs since last metrics collection.
int32_t m_collection_interval
Metrics collection interval
Abstract base class for application dispatch handlers registered with AsyncComm.
Declarations for MetricsCollectorGanglia.
Program options handling.
int64_t m_bytes_read
Bytes read since last metrics collection.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
void start_collecting()
Starts metrics collection.
virtual void handle(EventPtr &event)
Collects and publishes metrics.
virtual ~MetricsHandler()
Destructor.
Comm * m_comm
Comm layer pointer.
MetricsProcess m_metrics_process
General process metrics tracker.
Declarations for DispatchHandler.
Declarations for MetricsProcess.
void add_bytes_read(int64_t count)
Adds bytes read.
std::shared_ptr< Properties > PropertiesPtr
void add_bytes_written(int64_t count)
Adds bytes written.
int64_t m_last_timestamp
Timestamp of last metrics collection
int32_t m_errors
Error count since last metrics collection.
std::shared_ptr< MetricsCollectorGanglia > MetricsCollectorGangliaPtr
Smart pointer to MetricsCollectorGanglia.
Collects and publishes FsBroker metrics.
void add_sync(int64_t latency_nsec)
Adds sync information.
int64_t m_bytes_written
Bytes written since last metrics collection.
Entry point to AsyncComm service.
MetricsCollectorGangliaPtr m_ganglia_collector
Ganglia metrics collector.
std::string m_type
FsBroker type (e.g. "local", "qfs", etc.)
Computes and publishes general process metrics.
MetricsHandler(PropertiesPtr &props, const std::string &type)
Constructor.
int32_t m_sync_latency
Cumulative sync latency since last metrics collection.
std::mutex m_mutex
Mutex for serializing access to members
std::shared_ptr< MetricsHandler > MetricsHandlerPtr
Smart pointer to MetricsHandler.
void stop_collecting()
Stops metrics collection.
void increment_error_count()
Increments error count.