28 #ifndef Common_MetricsCollectorGanglia_h
29 #define Common_MetricsCollectorGanglia_h
37 #include <unordered_map>
66 void update(
const std::string &name,
const std::string &value)
override;
73 void update(
const std::string &name, int16_t value)
override;
80 void update(
const std::string &name, int32_t value)
override;
87 void update(
const std::string &name,
float value)
override;
94 void update(
const std::string &name,
double value)
override;
149 #endif // Common_MetricsCollectorGanglia_h
Declarations for MetricsCollector.
Program options handling.
std::string m_prefix
Metric name prefix ("ht." + component + ".")
std::mutex m_mutex
Mutex for serializing access to members
uint16_t m_port
Ganglia hypertable extension listen port.
~MetricsCollectorGanglia()
Destructor.
Abstract metrics collector.
int m_sd
Datagram send socket.
std::unordered_map< std::string, std::string > m_values_string
Map holding string metric values.
std::shared_ptr< Properties > PropertiesPtr
std::unordered_map< std::string, int32_t > m_values_int
Map holding integer metric values.
std::shared_ptr< MetricsCollectorGanglia > MetricsCollectorGangliaPtr
Smart pointer to MetricsCollectorGanglia.
Ganglia metrics collector.
void update(const std::string &name, const std::string &value) override
Updates string metric value.
void connect()
Connects to Ganglia hypertable extension receive port.
MetricsCollectorGanglia(const std::string &component, PropertiesPtr &props)
Constructor.
bool m_connected
Flag indicating if socket is connected.
std::unordered_map< std::string, double > m_values_double
Map holding floating point metric values.
bool m_disabled
Flag indicating if publishing is disabled.
std::string m_message
Persistent string for holding JSON string.
void publish() override
Publishes metric values to Ganglia hypertable extension.