mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Graphite simplification
This commit is contained in:
parent
4bf120b285
commit
d21a2a057b
@ -9,6 +9,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <chrono>
|
||||||
#include <Poco/Process.h>
|
#include <Poco/Process.h>
|
||||||
#include <Poco/ThreadPool.h>
|
#include <Poco/ThreadPool.h>
|
||||||
#include <Poco/TaskNotification.h>
|
#include <Poco/TaskNotification.h>
|
||||||
@ -124,6 +125,14 @@ public:
|
|||||||
writer->write(key_vals, timestamp, custom_root_path);
|
writer->write(key_vals, timestamp, custom_root_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
void writeToGraphite(const GraphiteWriter::KeyValueVector<T> & key_vals, const std::chrono::system_clock::time_point & current_time, const std::string & custom_root_path)
|
||||||
|
{
|
||||||
|
auto writer = getGraphiteWriter();
|
||||||
|
if (writer)
|
||||||
|
writer->write(key_vals, std::chrono::system_clock::to_time_t(current_time), custom_root_path);
|
||||||
|
}
|
||||||
|
|
||||||
GraphiteWriter * getGraphiteWriter(const std::string & config_name = DEFAULT_GRAPHITE_CONFIG_NAME)
|
GraphiteWriter * getGraphiteWriter(const std::string & config_name = DEFAULT_GRAPHITE_CONFIG_NAME)
|
||||||
{
|
{
|
||||||
if (graphite_writers.count(config_name))
|
if (graphite_writers.count(config_name))
|
||||||
|
Loading…
Reference in New Issue
Block a user