-
Notifications
You must be signed in to change notification settings - Fork 211
/
metrics.go
52 lines (44 loc) · 1.24 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
51
52
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/spacemeshos/go-spacemesh/metrics"
)
const (
namespace = "activation"
)
var PostDuration = metrics.NewGauge(
"post_duration",
namespace,
"duration of last PoST in nanoseconds",
[]string{},
).WithLabelValues()
var PoetPowDuration = metrics.NewGauge(
"poet_pow_duration",
namespace,
"duration of last PoET Proof of Work in nanoseconds",
[]string{},
).WithLabelValues()
var PostVerificationQueue = metrics.NewGauge(
"post_verification_waiting_total",
namespace,
"the number of POSTs waiting to be verified",
[]string{},
).WithLabelValues()
var (
publishWindowLatency = metrics.NewHistogramWithBuckets(
"publish_window_seconds",
namespace,
"how much time in seconds you have before window for poet registrations closes",
[]string{"condition"},
prometheus.ExponentialBuckets(1, 2, 10),
)
PublishOntimeWindowLatency = publishWindowLatency.WithLabelValues("ontime")
PublishLateWindowLatency = publishWindowLatency.WithLabelValues("late")
)
var PostVerificationLatency = metrics.NewHistogramWithBuckets(
"post_verification_seconds",
namespace,
"post verification in seconds",
[]string{},
prometheus.ExponentialBuckets(1, 2, 20),
).WithLabelValues()