From e6931f0c14d1d010a21be3f00a8474b8203ed0fb Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 29 Oct 2024 10:07:16 +0000 Subject: [PATCH] Rename metric --- packages/beacon-node/src/api/impl/validator/index.ts | 6 +++--- packages/beacon-node/src/api/impl/validator/utils.ts | 12 ++++++------ packages/beacon-node/src/metrics/metrics/beacon.ts | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/beacon-node/src/api/impl/validator/index.ts b/packages/beacon-node/src/api/impl/validator/index.ts index 86fe8ab1958..cd79e5f737a 100644 --- a/packages/beacon-node/src/api/impl/validator/index.ts +++ b/packages/beacon-node/src/api/impl/validator/index.ts @@ -729,7 +729,7 @@ export function getValidatorApi( ...getBlockValueLogInfo(engine.value), }); - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.BuilderCensorship, }); @@ -744,7 +744,7 @@ export function getValidatorApi( ...getBlockValueLogInfo(builder.value), }); - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.builder, reason: isEngineEnabled === false @@ -764,7 +764,7 @@ export function getValidatorApi( ...getBlockValueLogInfo(engine.value), }); - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.engine, reason: isBuilderEnabled === false diff --git a/packages/beacon-node/src/api/impl/validator/utils.ts b/packages/beacon-node/src/api/impl/validator/utils.ts index 7547e8ac2e1..137f362632e 100644 --- a/packages/beacon-node/src/api/impl/validator/utils.ts +++ b/packages/beacon-node/src/api/impl/validator/utils.ts @@ -63,7 +63,7 @@ export function selectBlockProductionSource( switch (builderSelection) { case routes.validator.BuilderSelection.ExecutionAlways: case routes.validator.BuilderSelection.ExecutionOnly: { - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.EnginePreferred, }); @@ -73,7 +73,7 @@ export function selectBlockProductionSource( case routes.validator.BuilderSelection.Default: case routes.validator.BuilderSelection.MaxProfit: { if (builderBoostFactor === MAX_BUILDER_BOOST_FACTOR) { - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BuilderPreferred, }); @@ -81,7 +81,7 @@ export function selectBlockProductionSource( } if (builderBoostFactor === BigInt(0)) { - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.EnginePreferred, }); @@ -89,14 +89,14 @@ export function selectBlockProductionSource( } if (engineBlockValue >= (builderBlockValue * builderBoostFactor) / BigInt(100)) { - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.engine, reason: EngineBlockSelectionReason.BlockValue, }); return ProducedBlockSource.engine; } - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BlockValue, }); @@ -105,7 +105,7 @@ export function selectBlockProductionSource( case routes.validator.BuilderSelection.BuilderAlways: case routes.validator.BuilderSelection.BuilderOnly: { - metrics?.blockProductionSelections.inc({ + metrics?.blockProductionSelectionResults.inc({ source: ProducedBlockSource.builder, reason: BuilderBlockSelectionReason.BuilderPreferred, }); diff --git a/packages/beacon-node/src/metrics/metrics/beacon.ts b/packages/beacon-node/src/metrics/metrics/beacon.ts index edb9160eaab..747b86542d4 100644 --- a/packages/beacon-node/src/metrics/metrics/beacon.ts +++ b/packages/beacon-node/src/metrics/metrics/beacon.ts @@ -161,11 +161,11 @@ export function createBeaconMetrics(register: RegistryMetricCreator) { help: "Count of blocks successfully produced", labelNames: ["source"], }), - blockProductionSelections: register.gauge< + blockProductionSelectionResults: register.gauge< | {source: ProducedBlockSource.engine; reason: EngineBlockSelectionReason} | {source: ProducedBlockSource.builder; reason: BuilderBlockSelectionReason} >({ - name: "beacon_block_production_selections_total", + name: "beacon_block_production_selection_results_total", help: "Count of all block production selection results", labelNames: ["source", "reason"], }),