Skip to content

Commit

Permalink
fix metrics (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor1996 authored and disksing committed Mar 29, 2018
1 parent 05d6a09 commit a119a70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/schedule/replica_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,18 @@ func (r *ReplicaChecker) checkOfflinePeer(region *core.RegionInfo) *Operator {
func (r *ReplicaChecker) checkBestReplacement(region *core.RegionInfo) *Operator {
oldPeer, oldScore := r.selectWorstPeer(region)
if oldPeer == nil {
checkerCounter.WithLabelValues("replica_checker", "all_right")
checkerCounter.WithLabelValues("replica_checker", "all_right").Inc()
return nil
}
storeID, newScore := r.selectBestReplacementStore(region, oldPeer)
if storeID == 0 {
checkerCounter.WithLabelValues("replica_checker", "no_replacement_store")
checkerCounter.WithLabelValues("replica_checker", "no_replacement_store").Inc()
return nil
}
// Make sure the new peer is better than the old peer.
if newScore <= oldScore {
log.Debugf("[region %d] newScore %f is not better than oldScore %f", region.GetId(), newScore, oldScore)
checkerCounter.WithLabelValues("replica_checker", "not_better")
checkerCounter.WithLabelValues("replica_checker", "not_better").Inc()
return nil
}
newPeer, err := r.cluster.AllocPeer(storeID)
Expand Down

0 comments on commit a119a70

Please sign in to comment.