mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +00:00
reused prev_timepoint
This commit is contained in:
parent
854da3b6a2
commit
2cfbd1e194
@ -93,19 +93,18 @@ void MetricLog::metricThreadFunction()
|
||||
{
|
||||
try
|
||||
{
|
||||
const auto prev_timepoint = desired_timepoint;
|
||||
|
||||
if (is_shutdown_metric_thread)
|
||||
break;
|
||||
|
||||
MetricLogElement elem;
|
||||
const auto prev_timepoint = std::chrono::system_clock::now();
|
||||
elem.event_time = std::chrono::system_clock::to_time_t(prev_timepoint);
|
||||
elem.milliseconds = time_in_milliseconds(prev_timepoint) - time_in_seconds(prev_timepoint) * 1000;
|
||||
|
||||
this->add(elem);
|
||||
|
||||
while (desired_timepoint <= std::chrono::system_clock::now())
|
||||
desired_timepoint += std::chrono::milliseconds(collect_interval_milliseconds);
|
||||
|
||||
std::this_thread::sleep_until(desired_timepoint);
|
||||
}
|
||||
catch (...)
|
||||
|
Loading…
Reference in New Issue
Block a user