rename new timing metrics, as `_total` suffix is implicit (#5917)

* track latest duration instead of total in new timing metrics

Change `db_checkpoint_seconds` and `state_replay_seconds` metrics to
record the latest duration instead of the total. `nim-metrics` already
synthesizes a `_total` metric from these implicitly.

* still have to use inc, metrics only synthesizes the name not the sum

* prefix with `beacon_dag`
This commit is contained in:
Etan Kissling 2024-02-20 20:34:41 +01:00 committed by GitHub
parent 9286eb6795
commit 88045a91cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ declareGauge beacon_current_active_validators, "Number of validators in the acti
declareGauge beacon_pending_deposits, "Number of pending deposits (state.eth1_data.deposit_count - state.eth1_deposit_index)" # On block
declareGauge beacon_processed_deposits_total, "Number of total deposits included on chain" # On block
declareCounter total_state_replay_seconds, "Total time spent replaying states"
declareCounter beacon_dag_state_replay_seconds, "Time spent replaying states"
const
EPOCHS_PER_STATE_SNAPSHOT* = 32
@ -1845,7 +1845,7 @@ proc updateState*(
let
assignDur = assignTick - startTick
replayDur = Moment.now() - assignTick
total_state_replay_seconds.inc(replayDur.toFloatSeconds)
beacon_dag_state_replay_seconds.inc(replayDur.toFloatSeconds)
# TODO https://github.com/status-im/nim-chronicles/issues/108
if (assignDur + replayDur) >= MinSignificantProcessingDuration:

View File

@ -51,8 +51,8 @@ declareGauge ticks_delay,
declareGauge next_action_wait,
"Seconds until the next attestation will be sent"
declareCounter total_db_checkpoint_seconds,
"Total time spent checkpointing the database to clear the WAL file"
declareCounter db_checkpoint_seconds,
"Time spent checkpointing the database to clear the WAL file"
proc doRunTrustedNodeSync(
db: BeaconChainDB,
@ -1392,7 +1392,7 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
let
dbCheckpointTick = Moment.now()
dbCheckpointDur = dbCheckpointTick - gcCollectionTick
total_db_checkpoint_seconds.inc(dbCheckpointDur.toFloatSeconds)
db_checkpoint_seconds.inc(dbCheckpointDur.toFloatSeconds)
if dbCheckpointDur >= MinSignificantProcessingDuration:
info "Database checkpointed", dur = dbCheckpointDur
else: