mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 22:22:00 +00:00
Bring back heavy metrics
This commit is contained in:
parent
89fc3f52f3
commit
94aab4276c
@ -1265,7 +1265,7 @@ void AsynchronousMetrics::update(TimePoint update_time)
|
|||||||
|
|
||||||
/// Add more metrics as you wish.
|
/// Add more metrics as you wish.
|
||||||
|
|
||||||
updateImpl(new_values);
|
updateImpl(new_values, update_time, current_time);
|
||||||
|
|
||||||
new_values["AsynchronousMetricsCalculationTimeSpent"] = watch.elapsedSeconds();
|
new_values["AsynchronousMetricsCalculationTimeSpent"] = watch.elapsedSeconds();
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ protected:
|
|||||||
|
|
||||||
Poco::Logger * log;
|
Poco::Logger * log;
|
||||||
private:
|
private:
|
||||||
virtual void updateImpl(AsynchronousMetricValues & new_values) = 0;
|
virtual void updateImpl(AsynchronousMetricValues & new_values, TimePoint update_time, TimePoint current_time) = 0;
|
||||||
virtual void logImpl(AsynchronousMetricValues &) {}
|
virtual void logImpl(AsynchronousMetricValues &) {}
|
||||||
|
|
||||||
ProtocolServerMetricsFunc protocol_server_metrics_func;
|
ProtocolServerMetricsFunc protocol_server_metrics_func;
|
||||||
|
@ -113,7 +113,7 @@ KeeperAsynchronousMetrics::KeeperAsynchronousMetrics(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeeperAsynchronousMetrics::updateImpl(AsynchronousMetricValues & new_values)
|
void KeeperAsynchronousMetrics::updateImpl(AsynchronousMetricValues & new_values, TimePoint /*update_time*/, TimePoint /*current_time*/)
|
||||||
{
|
{
|
||||||
#if USE_NURAFT
|
#if USE_NURAFT
|
||||||
{
|
{
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
const TinyContext & tiny_context;
|
const TinyContext & tiny_context;
|
||||||
|
|
||||||
void updateImpl(AsynchronousMetricValues & new_values) override;
|
void updateImpl(AsynchronousMetricValues & new_values, TimePoint update_time, TimePoint current_time) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ ServerAsynchronousMetrics::ServerAsynchronousMetrics(
|
|||||||
, heavy_metric_update_period(heavy_metrics_update_period_seconds)
|
, heavy_metric_update_period(heavy_metrics_update_period_seconds)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void ServerAsynchronousMetrics::updateImpl(AsynchronousMetricValues & new_values)
|
void ServerAsynchronousMetrics::updateImpl(AsynchronousMetricValues & new_values, TimePoint update_time, TimePoint current_time)
|
||||||
{
|
{
|
||||||
if (auto mark_cache = getContext()->getMarkCache())
|
if (auto mark_cache = getContext()->getMarkCache())
|
||||||
{
|
{
|
||||||
@ -268,6 +268,8 @@ void ServerAsynchronousMetrics::updateImpl(AsynchronousMetricValues & new_values
|
|||||||
updateKeeperInformation(*keeper_dispatcher, new_values);
|
updateKeeperInformation(*keeper_dispatcher, new_values);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
updateHeavyMetricsIfNeeded(current_time, update_time, new_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerAsynchronousMetrics::logImpl(AsynchronousMetricValues & new_values)
|
void ServerAsynchronousMetrics::logImpl(AsynchronousMetricValues & new_values)
|
||||||
|
@ -16,7 +16,7 @@ public:
|
|||||||
int heavy_metrics_update_period_seconds,
|
int heavy_metrics_update_period_seconds,
|
||||||
const ProtocolServerMetricsFunc & protocol_server_metrics_func_);
|
const ProtocolServerMetricsFunc & protocol_server_metrics_func_);
|
||||||
private:
|
private:
|
||||||
void updateImpl(AsynchronousMetricValues & new_values) override;
|
void updateImpl(AsynchronousMetricValues & new_values, TimePoint update_time, TimePoint current_time) override;
|
||||||
void logImpl(AsynchronousMetricValues & new_values) override;
|
void logImpl(AsynchronousMetricValues & new_values) override;
|
||||||
|
|
||||||
const Duration heavy_metric_update_period;
|
const Duration heavy_metric_update_period;
|
||||||
|
Loading…
Reference in New Issue
Block a user