mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
Add metric for reward cache build time
This commit is contained in:
@@ -303,9 +303,11 @@ impl<T: EthSpec> OperationPool<T> {
|
||||
.map_err(OpPoolError::GetAttestationsTotalBalanceError)?;
|
||||
|
||||
// Update the reward cache.
|
||||
let reward_timer = metrics::start_timer(&metrics::BUILD_REWARD_CACHE_TIME);
|
||||
let mut reward_cache = self.reward_cache.write();
|
||||
reward_cache.update(state)?;
|
||||
let reward_cache = RwLockWriteGuard::downgrade(reward_cache);
|
||||
drop(reward_timer);
|
||||
|
||||
// Split attestations for the previous & current epochs, so that we
|
||||
// can optimise them individually in parallel.
|
||||
|
||||
@@ -3,6 +3,10 @@ use lazy_static::lazy_static;
|
||||
pub use lighthouse_metrics::*;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref BUILD_REWARD_CACHE_TIME: Result<Histogram> = try_create_histogram(
|
||||
"op_pool_build_reward_cache_time",
|
||||
"Time to build the reward cache before packing attestations"
|
||||
);
|
||||
pub static ref ATTESTATION_PREV_EPOCH_PACKING_TIME: Result<Histogram> = try_create_histogram(
|
||||
"op_pool_attestation_prev_epoch_packing_time",
|
||||
"Time to pack previous epoch attestations"
|
||||
|
||||
Reference in New Issue
Block a user