Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statistics: add the missing schedule config items #1601

Merged
merged 1 commit into from
Jun 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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