2016-10-24 04:06:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
#include <ext/shared_ptr_helper.h>
|
|
|
|
#include <Storages/System/IStorageSystemOneBlock.h>
|
2016-10-24 04:06:27 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class AsynchronousMetrics;
|
2016-12-08 02:49:04 +00:00
|
|
|
class Context;
|
|
|
|
|
2016-10-24 04:06:27 +00:00
|
|
|
|
|
|
|
/** Implements system table asynchronous_metrics, which allows to get values of periodically (asynchronously) updated metrics.
|
|
|
|
*/
|
2018-07-24 14:28:56 +00:00
|
|
|
class StorageSystemAsynchronousMetrics : public ext::shared_ptr_helper<StorageSystemAsynchronousMetrics>, public IStorageSystemOneBlock<StorageSystemAsynchronousMetrics>
|
2016-10-24 04:06:27 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
std::string getName() const override { return "SystemAsynchronousMetrics"; }
|
2016-10-24 04:06:27 +00:00
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
static NamesAndTypesList getNamesAndTypes();
|
2016-10-24 04:06:27 +00:00
|
|
|
|
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
const AsynchronousMetrics & async_metrics;
|
2016-10-24 04:06:27 +00:00
|
|
|
|
2017-11-04 03:20:18 +00:00
|
|
|
protected:
|
2017-04-01 07:20:54 +00:00
|
|
|
StorageSystemAsynchronousMetrics(const std::string & name_, const AsynchronousMetrics & async_metrics_);
|
2018-07-24 14:28:56 +00:00
|
|
|
|
|
|
|
void fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo & query_info) const override;
|
2016-10-24 04:06:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|