Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Nov 16, 2023
1 parent 2572a3a commit fce7646
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/schedule/schedulers/scheduler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const maxScheduleRetries = 10

var (
denySchedulersByLabelerCounter = labeler.LabelerEventCounter.WithLabelValues("schedulers", "deny")
rulesCntStatusGauge = ruleStatusGauge.WithLabelValues("rule_count")
groupsCntStatusGauge = ruleStatusGauge.WithLabelValues("group_count")
)

// Controller is used to manage all schedulers.
Expand Down Expand Up @@ -128,8 +126,8 @@ func (c *Controller) CollectSchedulerMetrics() {
}
ruleCnt := ruleMgr.GetRulesCount()
groupCnt := ruleMgr.GetGroupsCount()
rulesCntStatusGauge.Set(float64(ruleCnt))
groupsCntStatusGauge.Set(float64(groupCnt))
ruleStatusGauge.WithLabelValues("rule_count").Set(float64(ruleCnt))
ruleStatusGauge.WithLabelValues("group_count").Set(float64(groupCnt))
}

func (c *Controller) isSchedulingHalted() bool {
Expand All @@ -140,9 +138,6 @@ func (c *Controller) isSchedulingHalted() bool {
func ResetSchedulerMetrics() {
schedulerStatusGauge.Reset()
ruleStatusGauge.Reset()
// create in map again
ruleStatusGauge.WithLabelValues("rule_count").Set(0)
ruleStatusGauge.WithLabelValues("group_count").Set(0)
}

// AddSchedulerHandler adds the HTTP handler for a scheduler.
Expand Down

0 comments on commit fce7646

Please sign in to comment.