Skip to content

Commit

Permalink
add counter for l1 blocks synced
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch committed Dec 9, 2024
1 parent 0d3dc46 commit e6da94c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions yarn-project/archiver/src/archiver/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class ArchiverInstrumentation {
private blockHeight: Gauge;
private blockSize: Gauge;
private syncDuration: Histogram;
private l1BlocksSynced: UpDownCounter;
private proofsSubmittedDelay: Histogram;
private proofsSubmittedCount: UpDownCounter;
private dbMetrics: LmdbMetrics;
Expand Down Expand Up @@ -59,6 +60,11 @@ export class ArchiverInstrumentation {
},
});

this.l1BlocksSynced = meter.createUpDownCounter(Metrics.ARCHIVER_L1_BLOCKS_SYNCED, {
description: 'Number of blocks synced from L1',
valueType: ValueType.INT,
});

this.dbMetrics = new LmdbMetrics(
meter,
{
Expand All @@ -84,6 +90,7 @@ export class ArchiverInstrumentation {
public processNewBlocks(syncTimePerBlock: number, blocks: L2Block[]) {
this.syncDuration.record(Math.ceil(syncTimePerBlock));
this.blockHeight.record(Math.max(...blocks.map(b => b.number)));
this.l1BlocksSynced.add(blocks.length);
for (const block of blocks) {
this.blockSize.record(block.body.txEffects.length);
}
Expand Down
1 change: 1 addition & 0 deletions yarn-project/telemetry-client/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const MEMPOOL_PROVER_QUOTE_COUNT = 'aztec.mempool.prover_quote_count';
export const MEMPOOL_PROVER_QUOTE_SIZE = 'aztec.mempool.prover_quote_size';

export const ARCHIVER_SYNC_DURATION = 'aztec.archiver.sync_duration';
export const ARCHIVER_L1_BLOCKS_SYNCED = 'aztec.archiver.l1_blocks_synced';
export const ARCHIVER_BLOCK_HEIGHT = 'aztec.archiver.block_height';
export const ARCHIVER_BLOCK_SIZE = 'aztec.archiver.block_size';
export const ARCHIVER_ROLLUP_PROOF_DELAY = 'aztec.archiver.rollup_proof_delay';
Expand Down

0 comments on commit e6da94c

Please sign in to comment.