2022-02-05 16:33:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/SystemLog.h>
|
|
|
|
#include <Core/NamesAndTypes.h>
|
|
|
|
#include <Core/NamesAndAliases.h>
|
|
|
|
#include <Processors/IProcessor.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
struct ProcessorProfileLogElement
|
|
|
|
{
|
|
|
|
time_t event_time{};
|
|
|
|
Decimal64 event_time_microseconds{};
|
|
|
|
|
2022-08-11 11:02:41 +00:00
|
|
|
UInt64 id{};
|
2022-02-27 17:07:34 +00:00
|
|
|
std::vector<UInt64> parent_ids;
|
|
|
|
|
2022-08-11 11:02:41 +00:00
|
|
|
UInt64 plan_step{};
|
|
|
|
UInt64 plan_group{};
|
|
|
|
|
2022-02-05 16:33:42 +00:00
|
|
|
String query_id;
|
|
|
|
String processor_name;
|
2022-02-27 17:07:34 +00:00
|
|
|
|
2022-02-05 16:33:42 +00:00
|
|
|
/// Milliseconds spend in IProcessor::work()
|
|
|
|
UInt32 elapsed_us{};
|
|
|
|
/// IProcessor::NeedData
|
2022-02-27 10:52:27 +00:00
|
|
|
UInt32 input_wait_elapsed_us{};
|
2022-02-05 16:33:42 +00:00
|
|
|
/// IProcessor::PortFull
|
2022-02-27 10:52:27 +00:00
|
|
|
UInt32 output_wait_elapsed_us{};
|
2022-02-05 16:33:42 +00:00
|
|
|
|
2022-08-11 11:02:41 +00:00
|
|
|
size_t input_rows{};
|
|
|
|
size_t input_bytes{};
|
|
|
|
size_t output_rows{};
|
|
|
|
size_t output_bytes{};
|
|
|
|
|
2022-02-05 16:33:42 +00:00
|
|
|
static std::string name() { return "ProcessorsProfileLog"; }
|
|
|
|
static NamesAndTypesList getNamesAndTypes();
|
|
|
|
static NamesAndAliases getNamesAndAliases() { return {}; }
|
|
|
|
void appendToBlock(MutableColumns & columns) const;
|
2022-04-17 21:49:39 +00:00
|
|
|
static const char * getCustomColumnList() { return nullptr; }
|
2022-02-05 16:33:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ProcessorsProfileLog : public SystemLog<ProcessorProfileLogElement>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProcessorsProfileLog(
|
|
|
|
ContextPtr context_,
|
|
|
|
const String & database_name_,
|
|
|
|
const String & table_name_,
|
|
|
|
const String & storage_def_,
|
|
|
|
size_t flush_interval_milliseconds_);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|