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