forked from prysmaticlabs/prysm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attestations in pool count metrics (prysmaticlabs#4930)
* Add metrics * Use it * Use it * Expose getters
- Loading branch information
1 parent
d65b935
commit d52bb40
Showing
9 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package attestations | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
var ( | ||
aggregatedAttsCount = promauto.NewGauge( | ||
prometheus.GaugeOpts{ | ||
Name: "aggregated_attestations_in_pool_count", | ||
Help: "The number of aggregated attestations in the pool.", | ||
}, | ||
) | ||
unaggregatedAttsCount = promauto.NewGauge( | ||
prometheus.GaugeOpts{ | ||
Name: "unaggregated_attestations_in_pool_count", | ||
Help: "The number of unaggregated attestations in the pool.", | ||
}, | ||
) | ||
) | ||
|
||
func (s *Service) updateMetrics() { | ||
aggregatedAttsCount.Set(float64(s.pool.AggregatedAttestationCount())) | ||
unaggregatedAttsCount.Set(float64(s.pool.UnaggregatedAttestationCount())) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters