Finish remaining required interop metrics (#477)

* implement beacon_finalized_root, beacon_current_justified_root, and beacon_previous_justified_root interop metrics
This commit is contained in:
Dustin Brody 2019-10-03 18:16:25 +00:00 committed by GitHub
parent 255980c9f6
commit 1a62c122d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,6 @@ import # TODO - cleanup imports
logScope: topics = "consens"
# TODO Implement the _root metrics
# https://github.com/ethereum/eth2.0-metrics/blob/master/metrics.md
declareGauge beacon_finalized_epoch, "Current finalized epoch" # On epoch transition
declareGauge beacon_finalized_root, "Current finalized root" # On epoch transition
@ -612,7 +611,12 @@ proc process_epoch*(state: var BeaconState) =
# Once per epoch metrics
beacon_finalized_epoch.set(state.finalized_checkpoint.epoch.int64)
beacon_finalized_root.set(state.finalized_checkpoint.root.toGaugeValue)
beacon_current_justified_epoch.set(
state.current_justified_checkpoint.epoch.int64)
beacon_current_justified_root.set(
state.current_justified_checkpoint.root.toGaugeValue)
beacon_previous_justified_epoch.set(
state.previous_justified_checkpoint.epoch.int64)
beacon_previous_justified_root.set(
state.previous_justified_checkpoint.root.toGaugeValue)