mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #10646 from yingnanzhang666/metrics_db_compaction
fix issue that metric db_compaction_total_duration_milliseconds is always 0
This commit is contained in:
commit
943d6887c4
@ -23,7 +23,7 @@ import (
|
||||
|
||||
func (s *store) scheduleCompaction(compactMainRev int64, keep map[revision]struct{}) bool {
|
||||
totalStart := time.Now()
|
||||
defer dbCompactionTotalMs.Observe(float64(time.Since(totalStart) / time.Millisecond))
|
||||
defer func() { dbCompactionTotalMs.Observe(float64(time.Since(totalStart) / time.Millisecond)) }()
|
||||
keyCompactions := 0
|
||||
defer func() { dbCompactionKeysCounter.Add(float64(keyCompactions)) }()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user