Skip to content

Commit 226a5ae

Browse files
committed
DPL: disable cpu_usage_fraction for proxies
1 parent a60bdb7 commit 226a5ae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Framework/Core/src/CommonServices.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "Framework/DeviceState.h"
4444
#include "Framework/DeviceConfig.h"
4545
#include "Framework/DefaultsHelpers.h"
46+
#include "Framework/Signpost.h"
4647

4748
#include "TextDriverClient.h"
4849
#include "WSDriverClient.h"
@@ -83,6 +84,7 @@ using Value = o2::monitoring::tags::Value;
8384
O2_DECLARE_DYNAMIC_LOG(data_processor_context);
8485
O2_DECLARE_DYNAMIC_LOG(stream_context);
8586
O2_DECLARE_DYNAMIC_LOG(async_queue);
87+
O2_DECLARE_DYNAMIC_LOG(policies);
8688

8789
namespace o2::framework
8890
{
@@ -849,6 +851,16 @@ o2::framework::ServiceSpec CommonServices::dataProcessingStats()
849851
if (deploymentMode != DeploymentMode::OnlineDDS && deploymentMode != DeploymentMode::OnlineECS && deploymentMode != DeploymentMode::OnlineAUX && deploymentMode != DeploymentMode::FST) {
850852
arrowAndResourceLimitingMetrics = true;
851853
}
854+
// Input proxies should not report cpu_usage_fraction,
855+
// because of the rate limiting which biases the measurement.
856+
auto& spec = services.get<DeviceSpec const>();
857+
bool enableCPUUsageFraction = true;
858+
auto isProxy = [](DataProcessorLabel const& label) -> bool { return label == DataProcessorLabel{"input-proxy"} || label == DataProcessorLabel{"output-proxy"}; };
859+
if (std::find_if(spec.labels.begin(), spec.labels.end(), isProxy) != spec.labels.end()) {
860+
O2_SIGNPOST_ID_GENERATE(mid, policies);
861+
O2_SIGNPOST_EVENT_EMIT(policies, mid, "metrics", "Disabling cpu_usage_fraction metric for proxy %{public}s", spec.name.c_str());
862+
enableCPUUsageFraction = false;
863+
}
852864

853865
std::vector<DataProcessingStats::MetricSpec> metrics = {
854866
MetricSpec{.name = "errors",
@@ -932,6 +944,7 @@ o2::framework::ServiceSpec CommonServices::dataProcessingStats()
932944
.maxRefreshLatency = onlineRefreshLatency,
933945
.sendInitialValue = true},
934946
MetricSpec{.name = "cpu_usage_fraction",
947+
.enabled = enableCPUUsageFraction,
935948
.metricId = (int)ProcessingStatsId::CPU_USAGE_FRACTION,
936949
.kind = Kind::Rate,
937950
.scope = Scope::Online,

0 commit comments

Comments
 (0)