13 #include <storage_client.h> 14 #include <unordered_map> 17 #include <condition_variable> 21 PerfMon(
const std::string& name);
39 virtual void writeData(
const std::string& table,
const InsertValues& values)
42 if (m_storage != NULL)
44 m_storage->insertTable(table, values);
48 Logger::getLogger()->error(
"Failed to save performace monitor data: "\
49 "storage client is null for servide '%s'",
60 inline void collect(
const std::string& name,
long value)
64 doCollection(name, value);
67 void setCollecting(
bool state);
69 bool isCollecting() {
return m_collecting; };
71 void doCollection(
const std::string& name,
long value);
73 std::string m_service;
75 std::thread *m_thread;
77 std::unordered_map<std::string, PerfMon *>
79 std::condition_variable m_cv;
int getValues(InsertValues &values)
Return the performance values to insert.
Definition: perfmonitor.cpp:54
void addValue(long value)
Collect a new value for the performance monitor.
Definition: perfmonitor.cpp:29
PerfMon(const std::string &name)
Constructor for an individual performance monitor.
Definition: perfmonitor.cpp:20
Client for accessing the storage service.
Definition: storage_client.h:43
Definition: perfmonitors.h:19