mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:41:27 +00:00
Metrics: set max and min runners during startup time (#3032)
This commit is contained in:
@@ -82,6 +82,7 @@ func NewService(
|
||||
}
|
||||
|
||||
func (s *Service) Start() error {
|
||||
s.metricsExporter.publishStatic(s.settings.MaxRunners, s.settings.MinRunners)
|
||||
for {
|
||||
s.logger.Info("waiting for message...")
|
||||
select {
|
||||
|
||||
@@ -297,6 +297,12 @@ func (m *metricsExporter) withBaseLabels(base baseLabels) {
|
||||
m.baseLabels = base
|
||||
}
|
||||
|
||||
func (m *metricsExporter) publishStatic(max, min int) {
|
||||
l := m.scaleSetLabels()
|
||||
maxRunners.With(l).Set(float64(max))
|
||||
minRunners.With(l).Set(float64(min))
|
||||
}
|
||||
|
||||
func (m *metricsExporter) publishStatistics(stats *actions.RunnerScaleSetStatistic) {
|
||||
l := m.scaleSetLabels()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user