Skip to content

Commit

Permalink
cpuS should only override running state, not any others
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Jun 19, 2024
1 parent 294444b commit d7b2de5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sarracenia/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,12 +1113,11 @@ def _resolve(self):
flow_status = 'idle'
elif (now-self.states[c][cfg]['metrics']['rxLast']) > self.configs[c][cfg]['options'].runStateThreshold_idle:
flow_status = 'idle'
else:
flow_status = 'running'

if (len(self.states[c][cfg]['instance_pids']) > 0) and self.states[c][cfg]['metrics']['msgRate'] > 0 and \
elif self.states[c][cfg]['metrics']['msgRate'] > 0 and \
self.states[c][cfg]['metrics']['msgRateCpu'] < self.configs[c][cfg]['options'].runStateThreshold_cpuSlow:
flow_status = 'cpuSlow'
else:
flow_status = 'running'

self.states[c][cfg]['resource_usage'] = copy.deepcopy(resource_usage)
self.configs[c][cfg]['status'] = flow_status
Expand Down

0 comments on commit d7b2de5

Please sign in to comment.