ClickHouse/dbms/src/Storages/System/StorageSystemMetrics.h
2017-06-06 20:18:32 +03:00

43 lines
1.0 KiB
C++

#pragma once
#include <ext/shared_ptr_helper.h>
#include <Storages/IStorage.h>
namespace DB
{
class Context;
/** Implements `metrics` system table, which provides information about the operation of the server.
*/
class StorageSystemMetrics : private ext::shared_ptr_helper<StorageSystemMetrics>, public IStorage
{
friend class ext::shared_ptr_helper<StorageSystemMetrics>;
public:
static StoragePtr create(const std::string & name_);
std::string getName() const override { return "SystemMetrics"; }
std::string getTableName() const override { return name; }
const NamesAndTypesList & getColumnsListImpl() const override { return columns; }
BlockInputStreams read(
const Names & column_names,
const ASTPtr & query,
const Context & context,
QueryProcessingStage::Enum & processed_stage,
size_t max_block_size,
unsigned num_streams) override;
private:
const std::string name;
NamesAndTypesList columns;
StorageSystemMetrics(const std::string & name_);
};
}