From 1f6015b5b4a55ae6051f29a8942121d13f72d2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 6 May 2019 18:53:37 +0200 Subject: [PATCH] Update process.py --- benchmark/data/process.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/benchmark/data/process.py b/benchmark/data/process.py index 999e8bc..87bfd0c 100644 --- a/benchmark/data/process.py +++ b/benchmark/data/process.py @@ -34,16 +34,22 @@ def processFile(fname): else: responseCodes[code]=responseCodes[code]+1 responseTimes.append(item['response-time']) - maxResponse=max(responseTimes) - minResponse=min(responseTimes) + if len(responseTimes)!=0: + maxResponse=max(responseTimes) + minResponse=min(responseTimes) print("Maximum response time was ",maxResponse) print("Minimum response time was ",minResponse) + else: + print("csv is empty") pprint(responseCodes) for sec in responsePerSec: - print(sec, ":") - print(" Maximum:", max(responsePerSec[sec])) - print(" Minimum:", min(responsePerSec[sec])) - print(" Num of responses:", len(responsePerSec[sec])) + if len(responsePerSec[sec])!=0: + print(sec, ":") + print(" Maximum:", max(responsePerSec[sec])) + print(" Minimum:", min(responsePerSec[sec])) + print(" Num of responses:", len(responsePerSec[sec])) + else: + print(" empty") def processAllFiles(): files=getFiles()