ClickHouse/dbms/include/DB/Interpreters/PartLog.h
Ravengg b079dacfd1 Added part_log with statistics scripts (#549)
* Added part_log

* first_test

* filter and hits_res

* Add renamer and drawer

* Add columns database and table into PartLog

* Add normal way to get table_name and database_name from part

* improve drawer

* add stats for random size parts

* Merge converter and drawer

* make drawer more informative

* add new data

* add new data

* new data

* add long range stats

* for checking best way

* Add add_parts script

* Good style for global merge

* delete commented code

* Fixed spaces to tabs

* Note that Stopwatch is started automatically.

* Style

* Update StorageMergeTree.cpp

* Update StorageReplicatedMergeTree.cpp

* Switch act_time_ms to duration_ms

* Added ability to disable part_log

* fixed getPartLog

* fix usage getPartLog

* fix
2017-03-07 21:13:54 +04:00

45 lines
641 B
C++

#pragma once
#include <DB/Interpreters/SystemLog.h>
namespace DB
{
struct PartLogElement
{
enum Type
{
NEW_PART = 1,
MERGE_PARTS = 2,
DOWNLOAD_PART = 3,
};
Type event_type = NEW_PART;
time_t event_time{};
UInt64 size_in_bytes{};
UInt64 duration_ms{};
String database_name;
String table_name;
String part_name;
Strings merged_from;
static std::string name() { return "PartLog"; }
static Block createBlock();
void appendToBlock(Block & block) const;
};
/// Instead of typedef - to allow forward declaration.
class PartLog : public SystemLog<PartLogElement>
{
using SystemLog<PartLogElement>::SystemLog;
};
}