summaryrefslogtreecommitdiff
path: root/tools/util.py
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-15 16:44:35 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-16 09:37:38 -0400
commitc61a0f2f84e619a70704b59fd72cd7da863d4461 (patch)
tree275323c80a4791b311073150f1df8d98d3a8df1b /tools/util.py
parent62962e71fe244a4b0992185f2ba900ba3fd5005e (diff)
First pass at http benchmark.
Diffstat (limited to 'tools/util.py')
-rw-r--r--tools/util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/util.py b/tools/util.py
index 2620e706f..10b6b9c6f 100644
--- a/tools/util.py
+++ b/tools/util.py
@@ -324,3 +324,11 @@ def extract_number(pattern, string):
if len(matches) != 1:
return None
return int(matches[0])
+
+
+def parse_wrk_output(output):
+ req_per_sec = None
+ for line in output.split("\n"):
+ if req_per_sec is None:
+ req_per_sec = extract_number(r'Requests/sec:\s+(\d+)', line)
+ return req_per_sec