From 47bb8b7cc2c6e7ce08d07d7ffd9781adbef43490 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 28 Jan 2018 10:23:44 -0500 Subject: [PATCH] graphstats: Fix for print_stall detection The print_stall logic could cause large portions of the graph to show up as 100% host utilized. Rework the logic to avoid that. Signed-off-by: Kevin O'Connor --- scripts/graphstats.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/graphstats.py b/scripts/graphstats.py index db55e97e..ee6eeb94 100755 --- a/scripts/graphstats.py +++ b/scripts/graphstats.py @@ -49,12 +49,12 @@ def find_print_restarts(data): # Check for buffer runoff sampletime = d['#sampletime'] buffer_time = float(d.get('buffer_time', 0.)) - if buffer_time < 1. or (buffer_time < MAXBUFFER - and buffer_time > last_buffer_time): - if not last_runoff_start: - last_runoff_start = last_sampletime - runoff_samples[last_runoff_start] = [False, []] + if (last_runoff_start and last_sampletime - sampletime < 5 + and buffer_time > last_buffer_time): runoff_samples[last_runoff_start][1].append(sampletime) + elif buffer_time < 1.: + last_runoff_start = sampletime + runoff_samples[last_runoff_start] = [False, [sampletime]] else: last_runoff_start = 0. last_buffer_time = buffer_time