summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrare/interrupts-graph.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/rare/interrupts-graph.py b/rare/interrupts-graph.py
index dbef311..7417726 100755
--- a/rare/interrupts-graph.py
+++ b/rare/interrupts-graph.py
@@ -232,7 +232,7 @@ def update():
"""Reads new data and updates the line values."""
global update_legend
# Update lines
- for name, n in get_diffs():
+ for name in names:
ys = yvalues[name]
# Consider only strictly positive values
ydata = [y for y in ys if y > 0]
@@ -328,19 +328,22 @@ def refresh_data_timer():
t.start()
refresh_data()
-# Fill xrange of entries
if not input_is_proc:
- for i in range(0, int(XRANGE / INTERVAL)):
- if not refresh_data():
- break
-refresh_data_timer()
-
-while running:
- if not paused:
- update()
+ # Read all yvalues data from file
+ while refresh_data():
+ pass
+ update()
do_draw()
- plt.pause(INTERVAL)
+ # Block until exited
+ plt.show()
+else:
+ refresh_data_timer()
+
+ while running:
+ if not paused:
+ update()
+ do_draw()
+ plt.pause(INTERVAL)
-# Cancel any scheduled timer
-if t:
+ # Cancel any scheduled timer
t.cancel()