70 int64_t elapsed_seconds = elapsed_millis / 1000;
74 lock_guard<mutex> lock(
m_mutex);
81 if (elapsed_millis > 0) {
82 double sps = (double)
m_syncs / (
double)elapsed_seconds;
84 int64_t mbps = (
m_bytes_read / 1000000) / elapsed_seconds;
102 HT_INFOF(
"Problem publishing Ganglia metrics - %s", e.what());
110 HT_FATALF(
"Unrecognized event - %s", event->to_str().c_str());
static Comm * instance()
Creates/returns singleton instance of the Comm class.
int32_t m_syncs
Syncs since last metrics collection.
int32_t m_collection_interval
Metrics collection interval
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.
Comm * m_comm
Comm layer pointer.
MetricsProcess m_metrics_process
General process metrics tracker.
const char * get_text(int error)
Returns a descriptive error message.
std::shared_ptr< Properties > PropertiesPtr
Logging routines and macros.
Compatibility Macros for C/C++.
int64_t m_last_timestamp
Timestamp of last metrics collection
int32_t m_errors
Error count since last metrics collection.
#define HT_FATALF(msg,...)
Declarations for MetricsHandler.
int64_t m_bytes_written
Bytes written since last metrics collection.
MetricsCollectorGangliaPtr m_ganglia_collector
Ganglia metrics collector.
std::string m_type
FsBroker type (e.g. "local", "qfs", etc.)
#define HT_INFOF(msg,...)
MetricsHandler(PropertiesPtr &props, const std::string &type)
Constructor.
int32_t m_sync_latency
Cumulative sync latency since last metrics collection.
This is a generic exception class for Hypertable.
void collect(int64_t now, MetricsCollector *collector) override
Collects process metrics.
std::mutex m_mutex
Mutex for serializing access to members
int set_timer(uint32_t duration_millis, const DispatchHandlerPtr &handler)
Sets a timer for duration_millis milliseconds in the future.
void cancel_timer(const DispatchHandlerPtr &handler)
Cancels all scheduled timers registered with the dispatch handler handler.
File system broker framework and client library.
Error codes, Exception handling, error logging.
void stop_collecting()
Stops metrics collection.
int64_t get_ts64()
Returns the current time in nanoseconds as a 64bit number.