Skip to content

Commit 9e9d20d

Browse files
authored
refactor: use shorter alias for aggregated attestation pool metrics (#7688)
Just read this part of code again and the long metric variable name makes is a bit to verbose imo, didn't wanna push changes to #7673 though
1 parent c4068dc commit 9e9d20d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export class AggregatedAttestationPool {
425425
}
426426

427427
private onScrapeMetrics(metrics: Metrics): void {
428-
const aggregatedAttestationPoolMetrics = metrics.opPool.aggregatedAttestationPool;
428+
const poolMetrics = metrics.opPool.aggregatedAttestationPool;
429429
const allSlots = Array.from(this.attestationGroupByIndexByDataHexBySlot.keys());
430430

431431
// last item is current slot, we want the previous one, if available.
@@ -438,7 +438,7 @@ export class AggregatedAttestationPool {
438438
if (previousSlot !== null) {
439439
const groupByIndexByDataHex = this.attestationGroupByIndexByDataHexBySlot.get(previousSlot);
440440
if (groupByIndexByDataHex != null) {
441-
aggregatedAttestationPoolMetrics.attDataPerSlot.set(groupByIndexByDataHex.size);
441+
poolMetrics.attDataPerSlot.set(groupByIndexByDataHex.size);
442442

443443
let maxAttestations = 0;
444444
let committeeCount = 0;
@@ -447,14 +447,14 @@ export class AggregatedAttestationPool {
447447
for (const group of groupByIndex.values()) {
448448
const attestationCountInGroup = group.getAttestationCount();
449449
maxAttestations = Math.max(maxAttestations, attestationCountInGroup);
450-
aggregatedAttestationPoolMetrics.attestationsPerCommittee.observe(attestationCountInGroup);
450+
poolMetrics.attestationsPerCommittee.observe(attestationCountInGroup);
451451
committeeCount += 1;
452452

453453
attestationCount += attestationCountInGroup;
454454
}
455455
}
456-
aggregatedAttestationPoolMetrics.maxAttestationsPerCommittee.set(maxAttestations);
457-
aggregatedAttestationPoolMetrics.committeesPerSlot.set(committeeCount);
456+
poolMetrics.maxAttestationsPerCommittee.set(maxAttestations);
457+
poolMetrics.committeesPerSlot.set(committeeCount);
458458
}
459459
}
460460

@@ -471,8 +471,8 @@ export class AggregatedAttestationPool {
471471
}
472472
}
473473

474-
aggregatedAttestationPoolMetrics.size.set(attestationCount);
475-
aggregatedAttestationPoolMetrics.uniqueData.set(attestationDataCount);
474+
poolMetrics.size.set(attestationCount);
475+
poolMetrics.uniqueData.set(attestationDataCount);
476476
}
477477
}
478478

0 commit comments

Comments
 (0)