Add new metrics (#11374)

* Better batch block warning

* New metrics

* Revert "Better batch block warning"

This reverts commit e21fcfcebe.

* More metrics

* Add activation and exit queues

* Gaz
This commit is contained in:
terencechain
2022-08-31 15:05:50 -07:00
committed by GitHub
parent b1e08307ed
commit c638e114db
11 changed files with 109 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ go_library(
"//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/attestation:go_default_library",
"@com_github_pkg_errors//:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
],
)

View File

@@ -10,6 +10,8 @@ import (
"sort"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prysmaticlabs/prysm/v3/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v3/beacon-chain/core/time"
"github.com/prysmaticlabs/prysm/v3/beacon-chain/core/validators"
@@ -21,6 +23,13 @@ import (
"github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1/attestation"
)
var (
activationQueueCount = promauto.NewGauge(prometheus.GaugeOpts{
Name: "activation_queue_count",
Help: "Number of validators in the activation queue",
})
)
// sortableIndices implements the Sort interface to sort newly activated validator indices
// by activation epoch and by index number.
type sortableIndices struct {
@@ -119,6 +128,7 @@ func ProcessRegistryUpdates(ctx context.Context, state state.BeaconState) (state
activationQ = append(activationQ, types.ValidatorIndex(idx))
}
}
activationQueueCount.Set(float64(len(activationQ)))
sort.Sort(sortableIndices{indices: activationQ, validators: vals})