output csv
This commit is contained in:
parent
57945c1265
commit
dc3e951346
@ -2,14 +2,15 @@
|
||||
import csv
|
||||
import os
|
||||
from pprint import pprint
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# Returns array of csv files in current directory
|
||||
|
||||
|
||||
def getFiles():
|
||||
files = [f for f in os.listdir('.') if os.path.isfile(f)]
|
||||
return[f for f in files if f.endswith('.csv')]
|
||||
|
||||
|
||||
def processFile(fname):
|
||||
with open(fname, 'r') as f:
|
||||
lines = []
|
||||
@ -37,25 +38,32 @@ def processFile(fname):
|
||||
if len(responseTimes) != 0:
|
||||
maxResponse = max(responseTimes)
|
||||
minResponse = min(responseTimes)
|
||||
print("Maximum response time was ",maxResponse)
|
||||
print("Minimum response time was ",minResponse)
|
||||
#print("Maximum response time was ", maxResponse)
|
||||
#print("Minimum response time was ", minResponse)
|
||||
else:
|
||||
print("csv is empty")
|
||||
pprint(responseCodes)
|
||||
#pprint(responseCodes)
|
||||
for sec in responsePerSec:
|
||||
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")
|
||||
#print(sec, ":")
|
||||
#print(" Maximum:", max(responsePerSec[sec]))
|
||||
#print(" Minimum:", min(responsePerSec[sec]))
|
||||
#print(" Num of responses:", len(responsePerSec[sec]))
|
||||
print(len(responsePerSec[sec]))
|
||||
#else:
|
||||
#print(" empty")
|
||||
|
||||
|
||||
def keychars(x):
|
||||
return int(x.split('.')[1])
|
||||
|
||||
|
||||
def processAllFiles():
|
||||
files=getFiles()
|
||||
files = sorted(getFiles(), key=keychars)
|
||||
for f in files:
|
||||
print("Processing ", f)
|
||||
#print("Processing ", f)
|
||||
processFile(f)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
processAllFiles()
|
||||
|
@ -1,2 +0,0 @@
|
||||
numpy
|
||||
matplotlib
|
Loading…
Reference in New Issue
Block a user