mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Metrics for sync aggregate fullness (#2439)
## Issue Addressed NA ## Proposed Changes Adds a metric to see how many set bits are in the sync aggregate for each beacon block being imported. ## Additional Info NA
This commit is contained in:
@@ -1976,10 +1976,22 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
|
||||
drop(validator_monitor);
|
||||
|
||||
metrics::observe(
|
||||
&metrics::OPERATIONS_PER_BLOCK_ATTESTATION,
|
||||
block.body().attestations().len() as f64,
|
||||
);
|
||||
// Only present some metrics for blocks from the previous epoch or later.
|
||||
//
|
||||
// This helps avoid noise in the metrics during sync.
|
||||
if block.slot().epoch(T::EthSpec::slots_per_epoch()) + 1 >= self.epoch()? {
|
||||
metrics::observe(
|
||||
&metrics::OPERATIONS_PER_BLOCK_ATTESTATION,
|
||||
block.body().attestations().len() as f64,
|
||||
);
|
||||
|
||||
if let Some(sync_aggregate) = block.body().sync_aggregate() {
|
||||
metrics::set_gauge(
|
||||
&metrics::BLOCK_SYNC_AGGREGATE_SET_BITS,
|
||||
sync_aggregate.num_set_bits() as i64,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let db_write_timer = metrics::start_timer(&metrics::BLOCK_PROCESSING_DB_WRITE);
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ lazy_static! {
|
||||
"beacon_block_processing_attestation_observation_seconds",
|
||||
"Time spent hashing and remembering all the attestations in the block"
|
||||
);
|
||||
pub static ref BLOCK_SYNC_AGGREGATE_SET_BITS: Result<IntGauge> = try_create_int_gauge(
|
||||
"block_sync_aggregate_set_bits",
|
||||
"The number of true bits in the last sync aggregate in a block"
|
||||
);
|
||||
|
||||
/*
|
||||
* Block Production
|
||||
|
||||
Reference in New Issue
Block a user