From a4bcb8504265366ba2d818bc6d7e73938cb9d255 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Tue, 25 Aug 2026 11:11:31 -0300 Subject: [PATCH] Add inter_arrival.py --- inter_arrival.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 inter_arrival.py diff --git a/inter_arrival.py b/inter_arrival.py new file mode 100644 index 0000000..bce9cee --- /dev/null +++ b/inter_arrival.py @@ -0,0 +1,25 @@ +# %% + +# Load logs.txt +with open('logs.txt', 'r') as file: + lines = file.readlines() + +# %% +import re +# Grep "inter-arrival_s=number" with regex +intervals = [] +for line in lines: + match = re.search(r'inter-arrival_s=([0-9.]+)', line) + if match: + intervals.append(float(match.group(1))) +# %% + +print(intervals) +# %% +import matplotlib.pyplot as plt +plt.plot(intervals) +plt.ylabel('Inter-arrival time (s)') +plt.xlabel('Sample') +plt.title('Inter-arrival time distribution') +plt.show() +# %%