Skip to content

Commit

Permalink
fix misused Reset
Browse files Browse the repository at this point in the history
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
  • Loading branch information
iosmanthus committed Apr 23, 2023
1 parent 1b75108 commit 1b87793
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkg/statistics/region_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,22 @@ func (r *RegionStatistics) Collect() {

// Reset resets the metrics of the regions' status.
func (r *RegionStatistics) Reset() {
regionStatusGauge.Reset()
offlineRegionStatusGauge.Reset()
regionMissPeerRegionCounter.Set(0)
regionExtraPeerRegionCounter.Set(0)
regionDownPeerRegionCounter.Set(0)
regionPendingPeerRegionCounter.Set(0)
regionLearnerPeerRegionCounter.Set(0)
regionEmptyRegionCounter.Set(0)
regionOversizedRegionCounter.Set(0)
regionUndersizedRegionCounter.Set(0)
regionWitnesssLeaderRegionCounter.Set(0)

offlineMissPeerRegionCounter.Set(0)
offlineExtraPeerRegionCounter.Set(0)
offlineDownPeerRegionCounter.Set(0)
offlinePendingPeerRegionCounter.Set(0)
offlineLearnerPeerRegionCounter.Set(0)
offlineOfflinePeerRegionCounter.Set(0)
}

// LabelStatistics is the statistics of the level of labels.
Expand Down

0 comments on commit 1b87793

Please sign in to comment.