Skip to content

Commit

Permalink
register metrics and adjust brief
Browse files Browse the repository at this point in the history
ref #5762

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
  • Loading branch information
ethercflow committed Dec 28, 2022
1 parent f72ed93 commit 8b9b751
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/schedule/operator/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,14 @@ func (b *Builder) brief() string {
return fmt.Sprintf("promote peer: store %s", b.toPromote)
case len(b.toDemote) > 0:
return fmt.Sprintf("demote peer: store %s", b.toDemote)
case len(b.targetLeaderStoreIDs) != 0:
return fmt.Sprintf("evict leader: from store %d to one in %v, or to %d (for compatibility)", b.originLeaderStoreID, b.targetLeaderStoreIDs, b.targetLeaderStoreID)
case b.originLeaderStoreID != b.targetLeaderStoreID:
return fmt.Sprintf("transfer leader: store %d to %d", b.originLeaderStoreID, b.targetLeaderStoreID)
case len(b.toWitness) > 0:
return fmt.Sprintf("switch peer: store %s to witness", b.toWitness)
case len(b.toNonWitness) > 0:
return fmt.Sprintf("switch peer: store %s to non-witness", b.toNonWitness)
case len(b.targetLeaderStoreIDs) != 0:
return fmt.Sprintf("evict leader: from store %d to one in %v, or to %d (for compatibility)", b.originLeaderStoreID, b.targetLeaderStoreIDs, b.targetLeaderStoreID)
case b.originLeaderStoreID != b.targetLeaderStoreID:
return fmt.Sprintf("transfer leader: store %d to %d", b.originLeaderStoreID, b.targetLeaderStoreID)
default:
return ""
}
Expand Down
1 change: 1 addition & 0 deletions server/schedulers/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func init() {
prometheus.MustRegister(schedulerStatus)
prometheus.MustRegister(balanceLeaderCounter)
prometheus.MustRegister(balanceRegionCounter)
prometheus.MustRegister(balanceWitnessCounter)
prometheus.MustRegister(hotSchedulerResultCounter)
prometheus.MustRegister(hotDirectionCounter)
prometheus.MustRegister(balanceDirectionCounter)
Expand Down

0 comments on commit 8b9b751

Please sign in to comment.