mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 12:06:57 +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 {
|
func (s *Service) Start() error {
|
||||||
|
s.metricsExporter.publishStatic(s.settings.MaxRunners, s.settings.MinRunners)
|
||||||
for {
|
for {
|
||||||
s.logger.Info("waiting for message...")
|
s.logger.Info("waiting for message...")
|
||||||
select {
|
select {
|
||||||
|
|||||||
@@ -297,6 +297,12 @@ func (m *metricsExporter) withBaseLabels(base baseLabels) {
|
|||||||
m.baseLabels = base
|
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) {
|
func (m *metricsExporter) publishStatistics(stats *actions.RunnerScaleSetStatistic) {
|
||||||
l := m.scaleSetLabels()
|
l := m.scaleSetLabels()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user