Skip to content

Commit

Permalink
Rename metric
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 29, 2024
1 parent e82df99 commit e6931f0
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 @@ -729,7 +729,7 @@ export function getValidatorApi(
...getBlockValueLogInfo(engine.value),
});

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

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

metrics?.blockProductionSelections.inc({
metrics?.blockProductionSelectionResults.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?.blockProductionSelections.inc({
metrics?.blockProductionSelectionResults.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?.blockProductionSelections.inc({
metrics?.blockProductionSelectionResults.inc({
source: ProducedBlockSource.builder,
reason: BuilderBlockSelectionReason.BuilderPreferred,
});
return ProducedBlockSource.builder;
}

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

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,
});
Expand All @@ -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,
});
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"],
}),
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"],
}),
Expand Down

0 comments on commit e6931f0

Please sign in to comment.