-
Notifications
You must be signed in to change notification settings - Fork 672
/
metrics.go
42 lines (35 loc) · 1.17 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package bootstrap
import (
"errors"
"github.com/prometheus/client_golang/prometheus"
)
type metrics struct {
numFetchedVts, numAcceptedVts,
numFetchedTxs, numAcceptedTxs prometheus.Counter
}
func (m *metrics) Initialize(registerer prometheus.Registerer) error {
m.numFetchedVts = prometheus.NewCounter(prometheus.CounterOpts{
Name: "bs_fetched_vts",
Help: "Number of vertices fetched during bootstrapping",
})
m.numAcceptedVts = prometheus.NewCounter(prometheus.CounterOpts{
Name: "bs_accepted_vts",
Help: "Number of vertices accepted during bootstrapping",
})
m.numFetchedTxs = prometheus.NewCounter(prometheus.CounterOpts{
Name: "bs_fetched_txs",
Help: "Number of transactions fetched during bootstrapping",
})
m.numAcceptedTxs = prometheus.NewCounter(prometheus.CounterOpts{
Name: "bs_accepted_txs",
Help: "Number of transactions accepted during bootstrapping",
})
return errors.Join(
registerer.Register(m.numFetchedVts),
registerer.Register(m.numAcceptedVts),
registerer.Register(m.numFetchedTxs),
registerer.Register(m.numAcceptedTxs),
)
}