aboutsummaryrefslogtreecommitdiff
path: root/scripts/thr_hist.py
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-09-03 00:13:58 -0400
committerDeterminant <[email protected]>2018-09-03 00:13:58 -0400
commitc3368b286fbb1d6b8c22af8ce21e57b5a5720445 (patch)
tree061de96c58873f642a24a151af1bf7ed937fb1c3 /scripts/thr_hist.py
parent2535cd89c13485cc4a8e68145c7cb5e8e9398e5c (diff)
parent17f7fd821cf71717a158e2c38699baa6ab2f2af8 (diff)
Merge branch 'master' of github.com:Determinant/hot-stuff
Diffstat (limited to 'scripts/thr_hist.py')
-rw-r--r--scripts/thr_hist.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/thr_hist.py b/scripts/thr_hist.py
index 6f6a43f..c5f2a72 100644
--- a/scripts/thr_hist.py
+++ b/scripts/thr_hist.py
@@ -24,17 +24,19 @@ if __name__ == '__main__':
parser.add_argument('--interval', type=float, default=1, required=False)
parser.add_argument('--output', type=str, default="hist.png", required=False)
args = parser.parse_args()
- commit_pat = re.compile('([^[].*) \[hotstuff info\].*got <fin decision=1')
+ commit_pat = re.compile('([^[].*) \[hotstuff info\] ([0-9.]*) [0-9.]*$')
interval = args.interval
begin_time = None
next_begin_time = None
cnt = 0
+ lat = 0
timestamps = []
values = []
for line in sys.stdin:
m = commit_pat.match(line)
if m:
timestamps.append(str2datetime(m.group(1)))
+ lat += float(m.group(2))
timestamps.sort()
for timestamp in timestamps:
if begin_time and timestamp < next_begin_time:
@@ -47,4 +49,5 @@ if __name__ == '__main__':
cnt = 1
values.append(cnt)
print(values)
+ print("lat = {:.3f}ms".format(lat / len(timestamps) * 1e3))
plot_thr(args.output)