2024-06-17 15:02:50 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Interpreters/SystemLog.h>
|
2024-06-20 15:40:50 +00:00
|
|
|
#include <Interpreters/PeriodicLog.h>
|
2024-06-17 15:02:50 +00:00
|
|
|
#include <Common/ErrorCodes.h>
|
|
|
|
#include <Core/NamesAndTypes.h>
|
|
|
|
#include <Core/NamesAndAliases.h>
|
|
|
|
#include <Storages/ColumnsDescription.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** ErrorLog is a log of error values measured at regular time interval.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct ErrorLogElement
|
|
|
|
{
|
|
|
|
time_t event_time{};
|
|
|
|
ErrorCodes::ErrorCode code{};
|
|
|
|
ErrorCodes::Value value{};
|
|
|
|
bool remote{};
|
|
|
|
|
|
|
|
static std::string name() { return "ErrorLog"; }
|
|
|
|
static ColumnsDescription getColumnsDescription();
|
|
|
|
static NamesAndAliases getNamesAndAliases() { return {}; }
|
|
|
|
void appendToBlock(MutableColumns & columns) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-06-20 15:40:50 +00:00
|
|
|
class ErrorLog : public PeriodicLog<ErrorLogElement>
|
2024-06-17 15:02:50 +00:00
|
|
|
{
|
2024-06-20 15:40:50 +00:00
|
|
|
using PeriodicLog<ErrorLogElement>::PeriodicLog;
|
2024-06-17 15:02:50 +00:00
|
|
|
|
2024-06-20 15:40:50 +00:00
|
|
|
protected:
|
|
|
|
void stepFunction(TimePoint current_time) override;
|
2024-06-17 15:02:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|