|
|
@@ -17,25 +17,42 @@ package snap
|
|
|
import "github.com/prometheus/client_golang/prometheus"
|
|
|
|
|
|
var (
|
|
|
- // TODO: save_fsync latency?
|
|
|
- saveDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
|
|
|
+ snapMarshallingSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
|
|
+ Namespace: "etcd_debugging",
|
|
|
+ Subsystem: "snap",
|
|
|
+ Name: "save_marshalling_duration_seconds",
|
|
|
+ Help: "The marshalling cost distributions of save called by snapshot.",
|
|
|
+
|
|
|
+ // lowest bucket start of upper bound 0.001 sec (1 ms) with factor 2
|
|
|
+ // highest bucket start of 0.001 sec * 2^13 == 8.192 sec
|
|
|
+ Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
|
|
+ })
|
|
|
+
|
|
|
+ snapSaveSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
|
|
Namespace: "etcd_debugging",
|
|
|
Subsystem: "snap",
|
|
|
Name: "save_total_duration_seconds",
|
|
|
Help: "The total latency distributions of save called by snapshot.",
|
|
|
- Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
|
|
+
|
|
|
+ // lowest bucket start of upper bound 0.001 sec (1 ms) with factor 2
|
|
|
+ // highest bucket start of 0.001 sec * 2^13 == 8.192 sec
|
|
|
+ Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
|
|
})
|
|
|
|
|
|
- marshallingDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
|
|
|
- Namespace: "etcd_debugging",
|
|
|
+ snapFsyncSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
|
|
+ Namespace: "etcd",
|
|
|
Subsystem: "snap",
|
|
|
- Name: "save_marshalling_duration_seconds",
|
|
|
- Help: "The marshalling cost distributions of save called by snapshot.",
|
|
|
- Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
|
|
+ Name: "fsync_duration_seconds",
|
|
|
+ Help: "The latency distributions of fsync called by snap.",
|
|
|
+
|
|
|
+ // lowest bucket start of upper bound 0.001 sec (1 ms) with factor 2
|
|
|
+ // highest bucket start of 0.001 sec * 2^13 == 8.192 sec
|
|
|
+ Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
|
|
})
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
|
- prometheus.MustRegister(saveDurations)
|
|
|
- prometheus.MustRegister(marshallingDurations)
|
|
|
+ prometheus.MustRegister(snapMarshallingSec)
|
|
|
+ prometheus.MustRegister(snapSaveSec)
|
|
|
+ prometheus.MustRegister(snapFsyncSec)
|
|
|
}
|