mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
backend: more metrics for bboltdb transcation
This commit is contained in:
parent
322c0df785
commit
2f1730fcae
@ -220,6 +220,9 @@ func (t *batchTx) commit(stop bool) {
|
||||
err := t.tx.Commit()
|
||||
// gofail: var afterCommit struct{}
|
||||
|
||||
rebalanceSec.Observe(t.tx.Stats().RebalanceTime.Seconds())
|
||||
spillSec.Observe(t.tx.Stats().SpillTime.Seconds())
|
||||
writeSec.Observe(t.tx.Stats().WriteTime.Seconds())
|
||||
commitSec.Observe(time.Since(start).Seconds())
|
||||
atomic.AddInt64(&t.backend.commits, 1)
|
||||
|
||||
|
@ -28,6 +28,39 @@ var (
|
||||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 14),
|
||||
})
|
||||
|
||||
rebalanceSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||
Namespace: "etcd_debugging",
|
||||
Subsystem: "disk",
|
||||
Name: "backend_commit_rebalance_duration_seconds",
|
||||
Help: "The latency distributions of commit.rebalance called by bboltdb backend.",
|
||||
|
||||
// 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),
|
||||
})
|
||||
|
||||
spillSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||
Namespace: "etcd_debugging",
|
||||
Subsystem: "disk",
|
||||
Name: "backend_commit_spill_duration_seconds",
|
||||
Help: "The latency distributions of commit.spill called by bboltdb backend.",
|
||||
|
||||
// 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),
|
||||
})
|
||||
|
||||
writeSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||
Namespace: "etcd_debugging",
|
||||
Subsystem: "disk",
|
||||
Name: "backend_commit_write_duration_seconds",
|
||||
Help: "The latency distributions of commit.write called by bboltdb backend.",
|
||||
|
||||
// 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),
|
||||
})
|
||||
|
||||
defragSec = prometheus.NewHistogram(prometheus.HistogramOpts{
|
||||
Namespace: "etcd",
|
||||
Subsystem: "disk",
|
||||
@ -54,6 +87,9 @@ var (
|
||||
|
||||
func init() {
|
||||
prometheus.MustRegister(commitSec)
|
||||
prometheus.MustRegister(rebalanceSec)
|
||||
prometheus.MustRegister(spillSec)
|
||||
prometheus.MustRegister(writeSec)
|
||||
prometheus.MustRegister(defragSec)
|
||||
prometheus.MustRegister(snapshotTransferSec)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user