|
|
|
@ -43,6 +43,7 @@ def main():
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
time, states, jobstates = get_data()
|
|
|
|
|
print(f'data got at {time}')
|
|
|
|
|
assert time not in ts.data
|
|
|
|
|
ts.data[time] = (states, jobstates)
|
|
|
|
|
ts.states |= states.keys()
|
|
|
|
@ -52,6 +53,7 @@ def main():
|
|
|
|
|
# Should probably save elsewhere and do atomic rename, but whatever.
|
|
|
|
|
with open(pickle_file, 'wb') as f:
|
|
|
|
|
pickle.dump(ts, f)
|
|
|
|
|
print('pickle saved')
|
|
|
|
|
|
|
|
|
|
# Show the plot
|
|
|
|
|
x = sorted(ts.data.keys()) # times
|
|
|
|
@ -60,6 +62,7 @@ def main():
|
|
|
|
|
# ys are transposed – we need vectors by times, not by states.
|
|
|
|
|
ys = list(zip(*ys))
|
|
|
|
|
plt.stackplot(x, *ys)
|
|
|
|
|
print('showing plot')
|
|
|
|
|
plt.show(block=False)
|
|
|
|
|
|
|
|
|
|
plt.pause(poll_rate)
|
|
|
|
|