-
Notifications
You must be signed in to change notification settings - Fork 210
/
metrics.go
50 lines (42 loc) · 1.34 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
48
49
50
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"
invalidPrevATX = "invalid_prev_atx"
)
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)
numProofsPrevATX = numProofs.WithLabelValues(invalidPrevATX)
numInvalidProofs = metrics.NewCounter(
"num_invalid_proofs",
namespace,
"number of invalid malfeasance proofs",
[]string{
typeLabel,
},
)
numMalformed = numInvalidProofs.WithLabelValues("mal")
numInvalidProofsATX = numInvalidProofs.WithLabelValues(multiATXs)
numInvalidProofsBallot = numInvalidProofs.WithLabelValues(multiBallots)
numInvalidProofsHare = numInvalidProofs.WithLabelValues(hareEquivocate)
numInvalidProofsPostIndex = numInvalidProofs.WithLabelValues(invalidPostIndex)
numInvalidProofsPrevATX = numInvalidProofs.WithLabelValues(invalidPrevATX)
)