1#pragma once
2
3#include <ext/shared_ptr_helper.h>
4#include <Storages/System/IStorageSystemOneBlock.h>
5
6namespace DB
7{
8
9class AsynchronousMetrics;
10class Context;
11
12
13/** Implements system table asynchronous_metrics, which allows to get values of periodically (asynchronously) updated metrics.
14 */
15class StorageSystemAsynchronousMetrics : public ext::shared_ptr_helper<StorageSystemAsynchronousMetrics>,
16 public IStorageSystemOneBlock<StorageSystemAsynchronousMetrics>
17{
18 friend struct ext::shared_ptr_helper<StorageSystemAsynchronousMetrics>;
19public:
20 std::string getName() const override { return "SystemAsynchronousMetrics"; }
21
22 static NamesAndTypesList getNamesAndTypes();
23
24private:
25 const AsynchronousMetrics & async_metrics;
26
27protected:
28 StorageSystemAsynchronousMetrics(const std::string & name_, const AsynchronousMetrics & async_metrics_);
29
30 void fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo & query_info) const override;
31};
32
33}
34