Skip to content

Commit 7994d1e

Browse files
authored
DPL improve signposts when flushing metrics (#14711)
1 parent b1904ff commit 7994d1e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Framework/Core/src/CommonServices.cxx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,30 +826,34 @@ auto flushMetrics(ServiceRegistryRef registry, DataProcessingStats& stats) -> vo
826826
auto& relayer = registry.get<DataRelayer>();
827827

828828
// Send all the relevant metrics for the relayer to update the GUI
829-
stats.flushChangedMetrics([&monitoring](DataProcessingStats::MetricSpec const& spec, int64_t timestamp, int64_t value) mutable -> void {
829+
stats.flushChangedMetrics([&monitoring, sid](DataProcessingStats::MetricSpec const& spec, int64_t timestamp, int64_t value) mutable -> void {
830830
// convert timestamp to a time_point
831831
auto tp = std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>(std::chrono::milliseconds(timestamp));
832832
auto metric = o2::monitoring::Metric{spec.name, Metric::DefaultVerbosity, tp};
833833
if (spec.kind == DataProcessingStats::Kind::UInt64) {
834834
if (value < 0) {
835-
LOG(debug) << "Value for " << spec.name << " is negative, setting to 0";
835+
O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Value for %{public}s is negative, setting to 0",
836+
spec.name.c_str());
836837
value = 0;
837838
}
838839
metric.addValue((uint64_t)value, "value");
839840
} else {
840841
if (value > (int64_t)std::numeric_limits<int>::max()) {
841-
LOG(warning) << "Value for " << spec.name << " is too large, setting to INT_MAX";
842+
O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Value for %{public}s is too large, setting to INT_MAX",
843+
spec.name.c_str());
842844
value = (int64_t)std::numeric_limits<int>::max();
843845
}
844846
if (value < (int64_t)std::numeric_limits<int>::min()) {
847+
O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Value for %{public}s is too small, setting to INT_MIN",
848+
spec.name.c_str());
845849
value = (int64_t)std::numeric_limits<int>::min();
846-
LOG(warning) << "Value for " << spec.name << " is too small, setting to INT_MIN";
847850
}
848851
metric.addValue((int)value, "value");
849852
}
850853
if (spec.scope == DataProcessingStats::Scope::DPL) {
851854
metric.addTag(o2::monitoring::tags::Key::Subsystem, o2::monitoring::tags::Value::DPL);
852855
}
856+
O2_SIGNPOST_EVENT_EMIT(monitoring_service, sid, "flushChangedMetrics", "Flushing metric %{public}s", spec.name.c_str());
853857
monitoring.send(std::move(metric));
854858
});
855859
relayer.sendContextState();

0 commit comments

Comments
 (0)