diff --git a/pkg/stats/monitor.go b/pkg/stats/monitor.go index 2225b81b..30cf342f 100644 --- a/pkg/stats/monitor.go +++ b/pkg/stats/monitor.go @@ -38,6 +38,7 @@ const ( ) type Service interface { + IsIdle() bool IsDisabled() bool IsTerminating() bool KillProcess(string, float64) diff --git a/pkg/stats/monitor_prom.go b/pkg/stats/monitor_prom.go index 1410a160..30698e95 100644 --- a/pkg/stats/monitor_prom.go +++ b/pkg/stats/monitor_prom.go @@ -68,7 +68,7 @@ func (m *Monitor) initPrometheus() { } func (m *Monitor) promIsIdle() float64 { - if !m.svc.IsDisabled() && m.requests.Load() == 0 { + if m.svc.IsIdle() { return 1 } return 0