2019-02-03 21:30:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-03-04 13:03:32 +00:00
|
|
|
#include <DataTypes/DataTypeEnum.h>
|
2020-01-16 12:37:29 +00:00
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
2019-02-03 21:30:45 +00:00
|
|
|
#include <Interpreters/SystemLog.h>
|
2020-01-16 12:37:29 +00:00
|
|
|
#include <Common/QueryProfiler.h>
|
|
|
|
#include <Common/TraceCollector.h>
|
2019-02-03 21:30:45 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
struct TraceLogElement
|
|
|
|
{
|
2020-01-15 10:51:51 +00:00
|
|
|
using TraceDataType = DataTypeEnum8;
|
|
|
|
static const TraceDataType::Values trace_values;
|
2019-02-03 21:30:45 +00:00
|
|
|
|
2020-01-15 10:51:51 +00:00
|
|
|
time_t event_time;
|
|
|
|
TraceType trace_type;
|
2020-02-03 11:45:36 +00:00
|
|
|
UInt64 thread_id;
|
2020-01-15 10:51:51 +00:00
|
|
|
String query_id;
|
|
|
|
Array trace;
|
2019-02-03 21:30:45 +00:00
|
|
|
|
2020-02-10 15:24:26 +00:00
|
|
|
UInt64 size; /// Allocation size in bytes for |TraceType::MEMORY|
|
2020-01-16 12:37:29 +00:00
|
|
|
|
2019-02-03 21:30:45 +00:00
|
|
|
static std::string name() { return "TraceLog"; }
|
|
|
|
static Block createBlock();
|
|
|
|
void appendToBlock(Block & block) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TraceLog : public SystemLog<TraceLogElement>
|
|
|
|
{
|
|
|
|
using SystemLog<TraceLogElement>::SystemLog;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|