diff --git a/Framework/Core/src/CommonServices.cxx b/Framework/Core/src/CommonServices.cxx index bc750181d54e2..23375b76487b9 100644 --- a/Framework/Core/src/CommonServices.cxx +++ b/Framework/Core/src/CommonServices.cxx @@ -768,8 +768,11 @@ auto sendRelayerMetrics(ServiceRegistryRef registry, DataProcessingStats& stats) using namespace fair::mq::shmem; auto& spec = registry.get(); + auto hasMetric = [&runningWorkflow](const DataProcessingStats::MetricSpec& metric) -> bool { + return metric.metricId == static_cast(ProcessingStatsId::AVAILABLE_MANAGED_SHM_BASE) + (runningWorkflow.shmSegmentId % 512); + }; // FIXME: Ugly, but we do it only every 5 seconds... - if (spec.name == "readout-proxy") { + if (std::find_if(stats.metricSpecs.begin(), stats.metricSpecs.end(), hasMetric) != stats.metricSpecs.end()) { auto device = registry.get().device(); long freeMemory = -1; try { @@ -1105,6 +1108,9 @@ o2::framework::ServiceSpec CommonServices::dataProcessingStats() .sendInitialValue = true}}; for (auto& metric : metrics) { + if (metric.metricId == (int)ProcessingStatsId::AVAILABLE_MANAGED_SHM_BASE + (runningWorkflow.shmSegmentId % 512) && spec.name.compare("readout-proxy") != 0) { + continue; + } stats->registerMetric(metric); }