-
Notifications
You must be signed in to change notification settings - Fork 211
/
metrics.go
47 lines (39 loc) · 1.16 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
43
44
45
46
47
package malfeasance
import (
"github.com/spacemeshos/go-spacemesh/metrics"
)
const (
namespace = "malfeasance"
typeLabel = "type"
multiATXs = "atx"
multiBallots = "ballot"
hareEquivocate = "hare_eq"
invalidPostIndex = "invalid_post_index"
)
var (
numProofs = metrics.NewCounter(
"num_proofs",
namespace,
"number of malfeasance proofs",
[]string{
typeLabel,
},
)
numProofsATX = numProofs.WithLabelValues(multiATXs)
numProofsBallot = numProofs.WithLabelValues(multiBallots)
numProofsHare = numProofs.WithLabelValues(hareEquivocate)
numProofsPostIndex = numProofs.WithLabelValues(invalidPostIndex)
numInvalidProofs = metrics.NewCounter(
"num_invalid_proofs",
namespace,
"number of invalid malfeasance proofs",
[]string{
typeLabel,
},
)
numInvalidProofsATX = numInvalidProofs.WithLabelValues(multiATXs)
numInvalidProofsBallot = numInvalidProofs.WithLabelValues(multiBallots)
numInvalidProofsHare = numInvalidProofs.WithLabelValues(hareEquivocate)
numInvalidProofsPostIndex = numInvalidProofs.WithLabelValues(invalidPostIndex)
numMalformed = numInvalidProofs.WithLabelValues("mal")
)