diff --git a/pkg/stats/monitor.go b/pkg/stats/monitor.go index d4740186..2510b1ce 100644 --- a/pkg/stats/monitor.go +++ b/pkg/stats/monitor.go @@ -42,7 +42,6 @@ type Monitor struct { requests atomic.Int32 mu sync.Mutex - enabled bool highCPUDuration int killProcess func(string, float64) pending map[string]*processStats @@ -70,7 +69,6 @@ const ( func NewMonitor(conf *config.ServiceConfig) *Monitor { return &Monitor{ cpuCostConfig: conf.CPUCostConfig, - enabled: true, pending: make(map[string]*processStats), procStats: make(map[int]*processStats), } @@ -271,10 +269,6 @@ func (m *Monitor) CanAcceptRequest(req *rpc.StartEgressRequest) bool { } func (m *Monitor) canAcceptRequestLocked(req *rpc.StartEgressRequest) bool { - if !m.enabled { - return false - } - accept := false total := m.cpuStats.NumCPU() @@ -363,12 +357,6 @@ func (m *Monitor) AcceptRequest(req *rpc.StartEgressRequest) error { return nil } -func (m *Monitor) SetEnabled(enabled bool) { - m.mu.Lock() - m.enabled = enabled - m.mu.Unlock() -} - func (m *Monitor) EgressStarted(req *rpc.StartEgressRequest) { switch req.Request.(type) { case *rpc.StartEgressRequest_RoomComposite: