Skip to content

Commit

Permalink
fix issue that metric db_compaction_total_duration_milliseconds is al…
Browse files Browse the repository at this point in the history
…ways 0
  • Loading branch information
yingnanzhang666 committed Apr 15, 2019
1 parent f29b1ad commit 91518b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mvcc/kvstore_compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)) }()

Expand Down

0 comments on commit 91518b9

Please sign in to comment.