Skip to content

Commit

Permalink
remove enabled from monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Jan 17, 2024
1 parent 70c2894 commit 7bea9d8
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions pkg/stats/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
}
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7bea9d8

Please sign in to comment.