Skip to content

Commit

Permalink
add total and scheduling size to the metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
3AceShowHand committed Dec 30, 2024
1 parent 9f7f3e3 commit cca699c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions coordinator/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,11 @@ func (c *Controller) newBootstrapMessage(id node.ID) *messaging.TargetMessage {

func (c *Controller) collectMetrics() {
if time.Since(c.lastPrintStatusTime) > time.Second*20 {
stopped := c.changefeedDB.GetStoppedSize()
working := c.changefeedDB.GetReplicatingSize()
absent := c.changefeedDB.GetAbsentSize()

metrics.ChangefeedStateGauge.WithLabelValues("Absent").Set(float64(absent))
metrics.ChangefeedStateGauge.WithLabelValues("Working").Set(float64(working))
metrics.ChangefeedStateGauge.WithLabelValues("Stopped").Set(float64(stopped))
metrics.ChangefeedStateGauge.WithLabelValues("Total").Set(float64(c.changefeedDB.GetSize()))
metrics.ChangefeedStateGauge.WithLabelValues("Working").Set(float64(c.changefeedDB.GetReplicatingSize()))
metrics.ChangefeedStateGauge.WithLabelValues("Scheduling").Set(float64(c.operatorController.OperatorSize()))
metrics.ChangefeedStateGauge.WithLabelValues("Absent").Set(float64(c.changefeedDB.GetAbsentSize()))
metrics.ChangefeedStateGauge.WithLabelValues("Stopped").Set(float64(c.changefeedDB.GetStoppedSize()))
c.lastPrintStatusTime = time.Now()
}
}

0 comments on commit cca699c

Please sign in to comment.