Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't poke vassals if there's not vassals
Fix #22
  • Loading branch information
xrmx committed Oct 9, 2015
1 parent 262e77f commit c45979f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions uwsgitop
Expand Up @@ -199,13 +199,14 @@ while True:

if 'vassals' in dd:
screen.addstr(0, 0, "uwsgi%s - %s - emperor: %s - tyrant: %d" % (uversion, time.ctime(), dd['emperor'], dd['emperor_tyrant']))
vassal_spaces = max([len(v['id']) for v in dd['vassals']])
screen.addstr(2, 0, " VASSAL%s\tPID\t" % (' ' * (vassal_spaces-6)), curses.A_REVERSE)
pos = 3
for vassal in dd['vassals']:
screen.addstr(pos, 0, " %s\t%d" % (vassal['id'].ljust(vassal_spaces), vassal['pid']))
pos += 1

if dd['vassals']:
vassal_spaces = max([len(v['id']) for v in dd['vassals']])
screen.addstr(2, 0, " VASSAL%s\tPID\t" % (' ' * (vassal_spaces-6)), curses.A_REVERSE)
pos = 3
for vassal in dd['vassals']:
screen.addstr(pos, 0, " %s\t%d" % (vassal['id'].ljust(vassal_spaces), vassal['pid']))
pos += 1

elif 'workers' in dd:
tot = sum( [worker['requests'] for worker in dd['workers']] )

Expand Down

0 comments on commit c45979f

Please sign in to comment.