Skip to content

Commit

Permalink
Fix metric name
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 28, 2024
1 parent b0c538c commit 13faa80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ export function getValidatorApi(
...getBlockValueLogInfo(engine.value),
});

metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.engine,
reason: EngineBlockSelectionReason.BuilderCensorship,
});
Expand All @@ -734,7 +734,7 @@ export function getValidatorApi(
...getBlockValueLogInfo(builder.value),
});

metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.builder,
reason:
isEngineEnabled === false
Expand All @@ -754,7 +754,7 @@ export function getValidatorApi(
...getBlockValueLogInfo(engine.value),
});

metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.engine,
reason:
isBuilderEnabled === false
Expand Down
12 changes: 6 additions & 6 deletions packages/beacon-node/src/api/impl/validator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function selectBlockProductionSource(
switch (builderSelection) {
case routes.validator.BuilderSelection.ExecutionAlways:
case routes.validator.BuilderSelection.ExecutionOnly: {
metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.engine,
reason: EngineBlockSelectionReason.EnginePreferred,
});
Expand All @@ -73,30 +73,30 @@ export function selectBlockProductionSource(
case routes.validator.BuilderSelection.Default:
case routes.validator.BuilderSelection.MaxProfit: {
if (builderBoostFactor === MAX_BUILDER_BOOST_FACTOR) {
metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.builder,
reason: BuilderBlockSelectionReason.BuilderPreferred,
});
return ProducedBlockSource.builder;
}

if (builderBoostFactor === BigInt(0)) {
metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.engine,
reason: EngineBlockSelectionReason.EnginePreferred,
});
return ProducedBlockSource.engine;
}

if (engineBlockValue >= (builderBlockValue * builderBoostFactor) / BigInt(100)) {
metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.engine,
reason: EngineBlockSelectionReason.BlockValue,
});
return ProducedBlockSource.engine;
}

metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.builder,
reason: BuilderBlockSelectionReason.BlockValue,
});
Expand All @@ -105,7 +105,7 @@ export function selectBlockProductionSource(

case routes.validator.BuilderSelection.BuilderAlways:
case routes.validator.BuilderSelection.BuilderOnly: {
metrics?.blockProductionSelection.inc({
metrics?.blockProductionSelections.inc({
source: ProducedBlockSource.builder,
reason: BuilderBlockSelectionReason.BuilderPreferred,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/src/metrics/metrics/beacon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
help: "Count of blocks successfully produced",
labelNames: ["source"],
}),
blockProductionSelection: register.gauge<
blockProductionSelections: register.gauge<
| {source: ProducedBlockSource.engine; reason: EngineBlockSelectionReason}
| {source: ProducedBlockSource.builder; reason: BuilderBlockSelectionReason}
>({
name: "beacon_block_production_selection_total",
name: "beacon_block_production_selections_total",
help: "Count of all block production selections by source and reason",
labelNames: ["source", "reason"],
}),
Expand Down

0 comments on commit 13faa80

Please sign in to comment.