diff --git a/lib/include/srsran/system/sys_metrics_processor.h b/lib/include/srsran/system/sys_metrics_processor.h index 1a819d222..b3471e5ad 100644 --- a/lib/include/srsran/system/sys_metrics_processor.h +++ b/lib/include/srsran/system/sys_metrics_processor.h @@ -56,7 +56,7 @@ class sys_metrics_processor }; public: - explicit sys_metrics_processor(srslog::basic_logger& log); + explicit sys_metrics_processor(srslog::basic_logger& logger); /// Measures and returns the system metrics. sys_metrics_t get_metrics(); @@ -78,7 +78,7 @@ private: cpu_metrics_t read_cpu_idle_from_line(const std::string& line) const; private: - srslog::basic_logger& log; + srslog::basic_logger& logger; proc_stats_info last_query = {}; cpu_metrics_t last_cpu_thread[metrics_max_supported_cpu] = {}; std::chrono::time_point last_query_time = std::chrono::steady_clock::now(); diff --git a/lib/src/system/sys_metrics_processor.cc b/lib/src/system/sys_metrics_processor.cc index 0660f270e..61e36385f 100644 --- a/lib/src/system/sys_metrics_processor.cc +++ b/lib/src/system/sys_metrics_processor.cc @@ -21,10 +21,10 @@ using namespace srsran; static const uint32_t cpu_count = ::sysconf(_SC_NPROCESSORS_CONF); static const float ticks_per_second = ::sysconf(_SC_CLK_TCK); -sys_metrics_processor::sys_metrics_processor(srslog::basic_logger& log) : log(log) +sys_metrics_processor::sys_metrics_processor(srslog::basic_logger& logger) : logger(logger) { if (cpu_count > metrics_max_supported_cpu) { - log.warning("Number of cpu is greater than supported. CPU metrics will be disabled."); + logger.warning("Number of cpu is greater than supported. CPU metrics will be disabled."); } } @@ -57,6 +57,7 @@ sys_metrics_t sys_metrics_processor::get_metrics() // The time elapsed between 2 measures must be greater that 100 milliseconds. if (measure_interval_ms < 100u) { + logger.warning("Interval less that 100ms, skipping measurement."); return {}; }