mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
Additional light client metrics (#6545)
* Fix db query and add some additional metrics * fmt * Update beacon_node/beacon_chain/src/metrics.rs Co-authored-by: Jimmy Chen <jchen.tc@gmail.com> * Update beacon_node/beacon_chain/src/metrics.rs Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -85,6 +85,7 @@ impl<T: BeaconChainTypes> LightClientServerCache<T> {
|
||||
log: &Logger,
|
||||
chain_spec: &ChainSpec,
|
||||
) -> Result<(), BeaconChainError> {
|
||||
metrics::inc_counter(&metrics::LIGHT_CLIENT_SERVER_CACHE_PROCESSING_REQUESTS);
|
||||
let _timer =
|
||||
metrics::start_timer(&metrics::LIGHT_CLIENT_SERVER_CACHE_RECOMPUTE_UPDATES_TIMES);
|
||||
|
||||
@@ -205,6 +206,7 @@ impl<T: BeaconChainTypes> LightClientServerCache<T> {
|
||||
*self.latest_light_client_update.write() = Some(new_light_client_update);
|
||||
}
|
||||
|
||||
metrics::inc_counter(&metrics::LIGHT_CLIENT_SERVER_CACHE_PROCESSING_SUCCESSES);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -280,6 +282,11 @@ impl<T: BeaconChainTypes> LightClientServerCache<T> {
|
||||
let (sync_committee_bytes, light_client_update_bytes) = res?;
|
||||
let sync_committee_period = u64::from_ssz_bytes(&sync_committee_bytes)
|
||||
.map_err(store::errors::Error::SszDecodeError)?;
|
||||
|
||||
if sync_committee_period >= start_period + count {
|
||||
break;
|
||||
}
|
||||
|
||||
let epoch = sync_committee_period
|
||||
.safe_mul(chain_spec.epochs_per_sync_committee_period.into())?;
|
||||
|
||||
@@ -290,10 +297,6 @@ impl<T: BeaconChainTypes> LightClientServerCache<T> {
|
||||
.map_err(store::errors::Error::SszDecodeError)?;
|
||||
|
||||
light_client_updates.push(light_client_update);
|
||||
|
||||
if sync_committee_period >= start_period + count {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Ok(light_client_updates)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user