mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
wal: document, clean up fsync histogram
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
1d91698268
commit
b0b966c43c
@ -17,15 +17,18 @@ package wal
|
||||
import "github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
var (
|
||||
syncDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||
walFsyncSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||
Namespace: "etcd",
|
||||
Subsystem: "disk",
|
||||
Name: "wal_fsync_duration_seconds",
|
||||
Help: "The latency distributions of fsync called by wal.",
|
||||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
||||
Help: "The latency distributions of fsync called by WAL.",
|
||||
|
||||
// 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(syncDurations)
|
||||
prometheus.MustRegister(walFsyncSec)
|
||||
}
|
||||
|
@ -590,7 +590,7 @@ func (w *WAL) sync() error {
|
||||
plog.Warningf("sync duration of %v, expected less than %v", took, warnSyncDuration)
|
||||
}
|
||||
}
|
||||
syncDurations.Observe(took.Seconds())
|
||||
walFsyncSec.Observe(took.Seconds())
|
||||
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user