From 0e6e3d201e277e598101ac175aafeb1c0bdc57ec Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 30 Jun 2021 19:42:54 +0200 Subject: [PATCH] sys_metrics: reduce log level when measurement interval is shorter than expected on highly loaded systems it can happen that the get_metrics() is called twice within a few houndred milliseconds. Logging a warning in this case isn't needed, so reduce to info. on the other hand, 100ms might be to convervative. Patch also lowers the smallest interval to 10ms --- lib/src/system/sys_metrics_processor.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/system/sys_metrics_processor.cc b/lib/src/system/sys_metrics_processor.cc index d5d616cf6..218bb2d72 100644 --- a/lib/src/system/sys_metrics_processor.cc +++ b/lib/src/system/sys_metrics_processor.cc @@ -69,9 +69,9 @@ sys_metrics_t sys_metrics_processor::get_metrics() uint32_t measure_interval_ms = std::chrono::duration_cast(current_time - last_query_time).count(); - // The time elapsed between 2 measures must be greater that 100 milliseconds. - if (measure_interval_ms < 100u) { - logger.warning("Interval less than 100ms, skipping measurement."); + // The time elapsed between 2 measures must be greater that 10 milliseconds. + if (measure_interval_ms < 10u) { + logger.info("Interval less than 10ms, skipping measurement."); return create_null_metrics(); }