From 8296c923cd99ce19130b633130e216d9bd482414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Tue, 30 Apr 2019 22:14:44 +0200 Subject: [PATCH] fasterer --- benchmark/process.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmark/process.py b/benchmark/process.py index ad4d21c..f214fde 100644 --- a/benchmark/process.py +++ b/benchmark/process.py @@ -26,9 +26,7 @@ def processFile(fname): def processor(lines): responseCodes={} responsePerSec={} - responseTimes=[line['response-time'] for line in lines] - maxResponse=max(responseTimes) - minResponse=min(responseTimes) + responseTimes=[] for line in lines: sec=int(line['offset'].split('.')[0]) if sec not in responsePerSec: @@ -40,6 +38,9 @@ def processor(lines): responseCodes[code]=1 else: responseCodes[code]=responseCodes[code]+1 + responseTimes.append(line['response-time']) + maxResponse=max(responseTimes) + minResponse=min(responseTimes) print("Maximum response time was ",maxResponse) print("Minimum response time was ",minResponse) pprint(responseCodes)