From 50063912a8d4668a7094fc877d770e5d02781dac Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Fri, 17 May 2019 19:57:13 -0400 Subject: [PATCH] Remove Expensive Participation Rate Prometheus Gauge (#2636) * rem expensive prom gauge * rem prom --- beacon-chain/core/state/BUILD.bazel | 2 -- beacon-chain/core/state/transition.go | 17 ----------------- shared/featureconfig/config.go | 2 +- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/beacon-chain/core/state/BUILD.bazel b/beacon-chain/core/state/BUILD.bazel index 28d2feac0..df4ae5f04 100644 --- a/beacon-chain/core/state/BUILD.bazel +++ b/beacon-chain/core/state/BUILD.bazel @@ -21,8 +21,6 @@ go_library( "//shared/hashutil:go_default_library", "//shared/params:go_default_library", "//shared/sliceutil:go_default_library", - "@com_github_prometheus_client_golang//prometheus:go_default_library", - "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@io_opencensus_go//trace:go_default_library", ], diff --git a/beacon-chain/core/state/transition.go b/beacon-chain/core/state/transition.go index d371750c1..fb902702a 100644 --- a/beacon-chain/core/state/transition.go +++ b/beacon-chain/core/state/transition.go @@ -7,10 +7,7 @@ import ( "bytes" "context" "fmt" - "strconv" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" bal "github.com/prysmaticlabs/prysm/beacon-chain/core/balances" b "github.com/prysmaticlabs/prysm/beacon-chain/core/blocks" e "github.com/prysmaticlabs/prysm/beacon-chain/core/epoch" @@ -28,15 +25,6 @@ import ( var log = logrus.WithField("prefix", "core/state") -var ( - correctAttestedValidatorGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ - Name: "correct_attested_validator_rate", - Help: "The % of validators correctly attested for source and target", - }, []string{ - "epoch", - }) -) - // TransitionConfig defines important configuration options // for executing a state transition, which can have logging and signature // verification on or off depending on when and where it is used. @@ -504,11 +492,6 @@ func ProcessEpoch(ctx context.Context, state *pb.BeaconState, block *pb.BeaconBl // Clean up processed attestations. state = e.CleanupAttestations(state) - // Log the useful metrics via prometheus. - correctAttestedValidatorGauge.WithLabelValues( - strconv.Itoa(int(currentEpoch)), - ).Set(float64(len(currentBoundaryAttesterIndices) / len(activeValidatorIndices))) - if config.Logging { log.WithField("currentEpochAttestations", len(currentEpochAttestations)).Info("Number of current epoch attestations") log.WithField("attesterIndices", currentBoundaryAttesterIndices).Debug("Current epoch boundary attester indices") diff --git a/shared/featureconfig/config.go b/shared/featureconfig/config.go index a9cf29707..b6e80549e 100644 --- a/shared/featureconfig/config.go +++ b/shared/featureconfig/config.go @@ -33,7 +33,7 @@ type FeatureFlagConfig struct { DisableGossipSub bool // DisableGossipSub in p2p messaging. EnableCommitteesCache bool // EnableCommitteesCache for state transition. CacheTreeHash bool // CacheTreeHash determent whether tree hashes will be cached. - EnableExcessDeposits bool // EnableExcessDeposits in validator balances. + EnableExcessDeposits bool // EnableExcessDeposits in validator balances. } var featureConfig *FeatureFlagConfig