Skip to content

Commit

Permalink
Add string representation for LoadState
Browse files Browse the repository at this point in the history
Signed-off-by: Shafreeck Sea <shafreeck@gmail.com>
  • Loading branch information
shafreeck committed Nov 4, 2019
1 parent 8fd71ce commit 1cc7b44
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server/cluster_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ const (
LoadStateNone
)

// String representation of LoadState
func (s LoadState) String() string {
switch s {
case LoadStateIdle:
return "idle"
case LoadStateLow:
return "low"
case LoadStateNormal:
return "normal"
case LoadStateHigh:
return "high"
}
return "none"
}

// NumberOfEntries is the max number of StatEntry that preserved,
// it is the history of a store's hearbeats. The interval of store
// hearbeats from TiKV is 10s, so we can preserve 300 entries per
Expand Down

0 comments on commit 1cc7b44

Please sign in to comment.