Commit 3c9c28ab authored by Florian Fischer's avatar Florian Fischer
Browse files

plot_tail_latency: catch iteration errors for broken latency data

parent 88293d75
Pipeline #82629 passed with stage
in 1 minute and 13 seconds
......@@ -12,6 +12,18 @@ import plot_utils
CSV_FIELDS = {'total': 0, 'after-send': 1, 'after-send-dispatch': 2}
def load_data(path, col):
try:
return np.loadtxt(path,
dtype=int,
delimiter=',',
skiprows=1,
usecols=col)
except StopIteration as e:
print(f'{e} occured for {path}', file=sys.stderr)
raise e
def get_bar_data(latency_files, latency='total', include_raw_data=False):
field = CSV_FIELDS[latency]
......@@ -21,12 +33,7 @@ def get_bar_data(latency_files, latency='total', include_raw_data=False):
for latency_file in latency_files:
path = pathlib.Path(latency_file)
impl = path.parent.name
ns = np.sort(
np.loadtxt(path,
dtype=int,
delimiter=',',
skiprows=1,
usecols=field))
ns = np.sort(load_data(path, field))
mean = np.mean(ns)
median, p95, p99, p99_9, p99_99 = np.percentile(ns, prctl)
......@@ -156,12 +163,7 @@ def plot_tail_latency_linear(latency_files, latency, out=None):
field = CSV_FIELDS[latency]
for latency_file in latency_files:
path = pathlib.Path(latency_file)
ns = np.sort(
np.loadtxt(path,
dtype=int,
delimiter=',',
skiprows=1,
usecols=field))
ns = np.sort(load_data(path, field))
echos = len(ns)
prct_90 = int(echos * 0.9)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment