ClickHouse/src/Interpreters/FilesystemReadPrefetchesLog.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.2 KiB
C++
Raw Normal View History

2023-02-07 17:50:31 +00:00
#pragma once
#include <Common/Priority.h>
#include <Common/Stopwatch.h>
2023-02-07 17:50:31 +00:00
#include <Core/NamesAndAliases.h>
#include <Core/NamesAndTypes.h>
#include <Interpreters/SystemLog.h>
#include <Storages/ColumnsDescription.h>
2023-02-07 17:50:31 +00:00
namespace DB
{
enum class FilesystemPrefetchState
{
USED,
CANCELLED_WITH_SEEK,
CANCELLED_WITH_RANGE_CHANGE,
UNNEEDED,
};
struct FilesystemReadPrefetchesLogElement
{
time_t event_time{};
String query_id;
String path;
UInt64 offset;
Int64 size; /// -1 means unknown
2023-04-27 17:07:00 +00:00
std::chrono::system_clock::time_point prefetch_submit_time;
2023-02-07 17:50:31 +00:00
std::optional<Stopwatch> execution_watch;
Priority priority;
2023-02-07 17:50:31 +00:00
FilesystemPrefetchState state;
UInt64 thread_id;
String reader_id;
static std::string name() { return "FilesystemReadPrefetchesLog"; }
static ColumnsDescription getColumnsDescription();
2023-02-07 17:50:31 +00:00
static NamesAndAliases getNamesAndAliases() { return {}; }
void appendToBlock(MutableColumns & columns) const;
};
class FilesystemReadPrefetchesLog : public SystemLog<FilesystemReadPrefetchesLogElement>
{
public:
using SystemLog<FilesystemReadPrefetchesLogElement>::SystemLog;
};
2023-05-22 17:51:58 +00:00
using FilesystemReadPrefetchesLogPtr = std::shared_ptr<FilesystemReadPrefetchesLog>;
2023-02-07 17:50:31 +00:00
}