2020-02-23 22:30:52 +00:00
|
|
|
package attestations
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
aggregatedAttsCount = promauto.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
2020-03-13 17:35:28 +00:00
|
|
|
Name: "aggregated_attestations_in_pool_total",
|
2020-02-23 22:30:52 +00:00
|
|
|
Help: "The number of aggregated attestations in the pool.",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
unaggregatedAttsCount = promauto.NewGauge(
|
|
|
|
prometheus.GaugeOpts{
|
2020-03-13 17:35:28 +00:00
|
|
|
Name: "unaggregated_attestations_in_pool_total",
|
2020-02-23 22:30:52 +00:00
|
|
|
Help: "The number of unaggregated attestations in the pool.",
|
|
|
|
},
|
|
|
|
)
|
2020-03-13 17:35:28 +00:00
|
|
|
expiredAggregatedAtts = promauto.NewCounter(prometheus.CounterOpts{
|
|
|
|
Name: "expired_aggregated_atts_total",
|
|
|
|
Help: "The number of expired and deleted aggregated attestations in the pool.",
|
|
|
|
})
|
|
|
|
expiredUnaggregatedAtts = promauto.NewCounter(prometheus.CounterOpts{
|
|
|
|
Name: "expired_unaggregated_atts_total",
|
|
|
|
Help: "The number of expired and deleted unaggregated attestations in the pool.",
|
|
|
|
})
|
|
|
|
expiredBlockAtts = promauto.NewCounter(prometheus.CounterOpts{
|
|
|
|
Name: "expired_block_atts_total",
|
|
|
|
Help: "The number of expired and deleted block attestations in the pool.",
|
|
|
|
})
|
2020-02-23 22:30:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (s *Service) updateMetrics() {
|
|
|
|
aggregatedAttsCount.Set(float64(s.pool.AggregatedAttestationCount()))
|
|
|
|
unaggregatedAttsCount.Set(float64(s.pool.UnaggregatedAttestationCount()))
|
|
|
|
}
|