mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
wal: use Histogram for syncDuration
This commit is contained in:
parent
fd07e02604
commit
1c7f52d931
@ -32,12 +32,12 @@ Failed proposals (`proposal_failed_total`) are normally related to two issues: t
|
|||||||
|
|
||||||
### wal
|
### wal
|
||||||
|
|
||||||
| Name | Description | Type |
|
| Name | Description | Type |
|
||||||
|------------------------------------|--------------------------------------------------|---------|
|
|------------------------------------|--------------------------------------------------|-----------|
|
||||||
| fsync_durations_microseconds | The latency distributions of fsync called by wal | Summary |
|
| fsync_durations_seconds | The latency distributions of fsync called by wal | Histogram |
|
||||||
| last_index_saved | The index of the last entry saved by wal | Gauge |
|
| last_index_saved | The index of the last entry saved by wal | Gauge |
|
||||||
|
|
||||||
Abnormally high fsync duration (`fsync_durations_microseconds`) indicates disk issues and might cause the cluster to be unstable.
|
Abnormally high fsync duration (`fsync_durations_seconds`) indicates disk issues and might cause the cluster to be unstable.
|
||||||
|
|
||||||
|
|
||||||
### http requests
|
### http requests
|
||||||
|
@ -17,11 +17,12 @@ package wal
|
|||||||
import "github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus"
|
import "github.com/coreos/etcd/Godeps/_workspace/src/github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
syncDurations = prometheus.NewSummary(prometheus.SummaryOpts{
|
syncDurations = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||||
Namespace: "etcd",
|
Namespace: "etcd",
|
||||||
Subsystem: "wal",
|
Subsystem: "wal",
|
||||||
Name: "fsync_durations_microseconds",
|
Name: "fsync_durations_seconds",
|
||||||
Help: "The latency distributions of fsync called by wal.",
|
Help: "The latency distributions of fsync called by wal.",
|
||||||
|
Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
||||||
})
|
})
|
||||||
lastIndexSaved = prometheus.NewGauge(prometheus.GaugeOpts{
|
lastIndexSaved = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Namespace: "etcd",
|
Namespace: "etcd",
|
||||||
|
@ -403,7 +403,7 @@ func (w *WAL) sync() error {
|
|||||||
}
|
}
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
err := w.f.Sync()
|
err := w.f.Sync()
|
||||||
syncDurations.Observe(float64(time.Since(start).Nanoseconds() / int64(time.Microsecond)))
|
syncDurations.Observe(float64(time.Since(start)) / float64(time.Second))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user