Skip to content

Commit

Permalink
statistics: add the missing schedule config items (tikv#1601)
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch committed Jul 3, 2019
1 parent fd8e0b2 commit 0ca02ef
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion server/statistics/store_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,35 @@ const (
)

// ScheduleOptions is an interface to access configurations.
// TODO: merge the Options to schedule.Options
type ScheduleOptions interface {
GetLocationLabels() []string
GetMaxStoreDownTime() time.Duration

GetLowSpaceRatio() float64
GetHighSpaceRatio() float64
GetTolerantSizeRatio() float64
GetStoreBalanceRate() float64

GetSchedulerMaxWaitingOperator() uint64
GetLeaderScheduleLimit(name string) uint64
GetRegionScheduleLimit(name string) uint64
GetReplicaScheduleLimit(name string) uint64
GetMergeScheduleLimit(name string) uint64
GetHotRegionScheduleLimit(name string) uint64
GetMaxReplicas(name string) int
GetHotRegionCacheHitsThreshold() int
GetMaxSnapshotCount() uint64
GetMaxPendingPeerCount() uint64
GetMaxMergeRegionSize() uint64
GetMaxMergeRegionKeys() uint64

IsRaftLearnerEnabled() bool
IsMakeUpReplicaEnabled() bool
IsRemoveExtraReplicaEnabled() bool
IsRemoveDownReplicaEnabled() bool
IsReplaceOfflineReplicaEnabled() bool

GetMaxStoreDownTime() time.Duration
}

type storeStatistics struct {
Expand Down Expand Up @@ -160,6 +173,13 @@ func (s *storeStatistics) Collect() {
configs["high_space_ratio"] = float64(s.opt.GetHighSpaceRatio())
configs["low_space_ratio"] = float64(s.opt.GetLowSpaceRatio())
configs["tolerant_size_ratio"] = float64(s.opt.GetTolerantSizeRatio())
configs["store-balance-rate"] = float64(s.opt.GetStoreBalanceRate())
configs["hot-region-schedule-limit"] = float64(s.opt.GetHotRegionScheduleLimit(s.namespace))
configs["hot-region-cache-hits-threshold"] = float64(s.opt.GetHotRegionCacheHitsThreshold())
configs["max-pending-peer-count"] = float64(s.opt.GetMaxPendingPeerCount())
configs["max-snapshot-count"] = float64(s.opt.GetMaxSnapshotCount())
configs["max-merge-region-size"] = float64(s.opt.GetMaxMergeRegionSize())
configs["max-merge-region-keys"] = float64(s.opt.GetMaxMergeRegionKeys())

var disableMakeUpReplica, disableLearner, disableRemoveDownReplica, disableRemoveExtraReplica, disableReplaceOfflineReplica float64
if !s.opt.IsMakeUpReplicaEnabled() {
Expand Down

0 comments on commit 0ca02ef

Please sign in to comment.