Skip to content

Commit

Permalink
add isIdle to monitor (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Jun 13, 2024
1 parent adddb74 commit 23d4004
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/stats/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
)

type Service interface {
IsIdle() bool
IsDisabled() bool
IsTerminating() bool
KillProcess(string, float64)
Expand Down
2 changes: 1 addition & 1 deletion pkg/stats/monitor_prom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23d4004

Please sign in to comment.