ClickHouse/src/Interpreters/TraceCollector.h

38 lines
588 B
C++
Raw Normal View History

2019-07-10 20:47:39 +00:00
#pragma once
#include <Common/ThreadPool.h>
#include <Common/TraceSender.h>
2019-07-10 20:47:39 +00:00
2020-01-16 12:37:29 +00:00
class StackTrace;
2019-07-10 20:47:39 +00:00
namespace Poco
{
class Logger;
}
namespace DB
{
class TraceLog;
class TraceCollector
{
2020-01-16 12:37:29 +00:00
public:
explicit TraceCollector(std::shared_ptr<TraceLog> trace_log_);
2020-01-16 12:37:29 +00:00
~TraceCollector();
static inline void collect(TraceType trace_type, const StackTrace & stack_trace, Int64 size)
{
return TraceSender::send(trace_type, stack_trace, size);
}
2020-01-16 12:37:29 +00:00
2019-07-10 20:47:39 +00:00
private:
std::shared_ptr<TraceLog> trace_log;
ThreadFromGlobalPool thread;
void run();
void stop();
2019-07-10 20:47:39 +00:00
};
}