From 86ea54e21ba0295343de8b4faa803f1474ccd86e Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 2 Oct 2025 10:32:58 +0200 Subject: [PATCH] Improving signposts --- Framework/Core/src/CommonServices.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Framework/Core/src/CommonServices.cxx b/Framework/Core/src/CommonServices.cxx index 22324cd84b390..5a2876e074d29 100644 --- a/Framework/Core/src/CommonServices.cxx +++ b/Framework/Core/src/CommonServices.cxx @@ -826,30 +826,34 @@ auto flushMetrics(ServiceRegistryRef registry, DataProcessingStats& stats) -> vo auto& relayer = registry.get(); // Send all the relevant metrics for the relayer to update the GUI - stats.flushChangedMetrics([&monitoring](DataProcessingStats::MetricSpec const& spec, int64_t timestamp, int64_t value) mutable -> void { + stats.flushChangedMetrics([&monitoring, sid](DataProcessingStats::MetricSpec const& spec, int64_t timestamp, int64_t value) mutable -> void { // convert timestamp to a time_point auto tp = std::chrono::time_point(std::chrono::milliseconds(timestamp)); auto metric = o2::monitoring::Metric{spec.name, Metric::DefaultVerbosity, tp}; if (spec.kind == DataProcessingStats::Kind::UInt64) { if (value < 0) { - LOG(debug) << "Value for " << spec.name << " is negative, setting to 0"; + O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Value for %{public}s is negative, setting to 0", + spec.name.c_str()); value = 0; } metric.addValue((uint64_t)value, "value"); } else { if (value > (int64_t)std::numeric_limits::max()) { - LOG(warning) << "Value for " << spec.name << " is too large, setting to INT_MAX"; + O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Value for %{public}s is too large, setting to INT_MAX", + spec.name.c_str()); value = (int64_t)std::numeric_limits::max(); } if (value < (int64_t)std::numeric_limits::min()) { + O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Value for %{public}s is too small, setting to INT_MIN", + spec.name.c_str()); value = (int64_t)std::numeric_limits::min(); - LOG(warning) << "Value for " << spec.name << " is too small, setting to INT_MIN"; } metric.addValue((int)value, "value"); } if (spec.scope == DataProcessingStats::Scope::DPL) { metric.addTag(o2::monitoring::tags::Key::Subsystem, o2::monitoring::tags::Value::DPL); } + O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Flushing metric %{public}s", spec.name.c_str()); monitoring.send(std::move(metric)); }); relayer.sendContextState();