-
Notifications
You must be signed in to change notification settings - Fork 210
/
metrics.go
45 lines (38 loc) · 1.07 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
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 (
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()