Skip to content

Commit

Permalink
add new metric for v9 to auto scale working (#585)
Browse files Browse the repository at this point in the history
* add new metric for v9 to auto scale working

* Associate watcher auto scale metric with Gauge Handler Reporter
  • Loading branch information
diegopereirawildlife authored May 18, 2023
1 parent b20b9b5 commit c67254b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reporters/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const (
EventResponseTime = "response.time"

EventNodeIpv6Status = "nodeIpv6.status"

EventWatcherAutoScale = "watcher.auto_scale"
)

//Reason{...} represents reasons for a pod/gru being deleted
Expand Down
1 change: 1 addition & 0 deletions reporters/dogstatsd/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var handlers = map[string]interface{}{
constants.EventPodStatus: GaugeHandler,
constants.EventResponseTime: TimingHandler,
constants.EventGruMetricUsage: GaugeHandler,
constants.EventWatcherAutoScale: GaugeHandler,
}

// Find looks for a matching handler to a given event
Expand Down
8 changes: 8 additions & 0 deletions watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,14 @@ func (w *Watcher) AutoScale() error {
})
logger.Info("starting auto scale")

if reporters.HasReporters() {
reporters.Report(reportersConstants.EventWatcherAutoScale, map[string]interface{}{
reportersConstants.TagGame: w.GameName,
reportersConstants.TagScheduler: w.SchedulerName,
reportersConstants.ValueGauge: 1,
})
}

scheduler, autoScalingInfo, roomCountByStatus, err := controller.GetSchedulerScalingInfo(
logger,
w.MetricsReporter,
Expand Down

0 comments on commit c67254b

Please sign in to comment.