Skip to content

Commit

Permalink
#1115 stopped flows were marked cpuS. fix
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Jun 19, 2024
1 parent 6337812 commit 294444b
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 @@ -492,7 +492,7 @@ def _read_state_dir(self):
if pathname[-4:] == '.pid':
i = int(pathname[-6:-4])
if t.isdigit():
#print( "%s/%s instance: %s, pid: %s" % ( c, cfg, i, t ) )
#print( "pid assignment: {c}/{cfg} instance: {i}, pid: {t}" )
self.states[c][cfg]['instance_pids'][i] = int(t)
elif pathname[-6:] == '.qname':
self.states[c][cfg]['queueName'] = t
Expand Down Expand Up @@ -1050,8 +1050,7 @@ def _resolve(self):
resource_usage={ 'uss': 0, 'rss': 0, 'vms':0, 'user_cpu': 0.0, 'system_cpu':0.0 }
nvip=False
for i in self.states[c][cfg]['instance_pids']:
if self.states[c][cfg]['instance_pids'][
i] not in self.procs:
if self.states[c][cfg]['instance_pids'][i] not in self.procs:
self.states[c][cfg]['missing_instances'].append(i)
else:
observed_instances += 1
Expand Down Expand Up @@ -1117,7 +1116,7 @@ def _resolve(self):
else:
flow_status = 'running'

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

Expand Down

0 comments on commit 294444b

Please sign in to comment.