Last active
August 29, 2015 14:01
-
-
Save tshev/8e6eaeeedda6be5e3e26 to your computer and use it in GitHub Desktop.
Siege visualisation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%pylab inline | |
import matplotlib.pylab as plt | |
import re | |
class Vs: | |
def __init__(self,fname): | |
self.fname = fname | |
self.readDate() | |
self.count = 0 | |
self.time = [] | |
def readDate(self): | |
self.count = 0 | |
self.time = [] | |
resL, timeL = [], [] | |
regex = re.compile("\s+") | |
for i in open(self.fname): | |
self.count+=1 | |
res, time = regex.split(i)[1:3] | |
resL.append(res.strip()) | |
timeL.append(time.strip()) | |
return resL[0:-5], timeL[0:-5] | |
res, time = Vs("/home/tshev/higload.test").readDate() | |
r = [float(i) for i in time if i.find(".")] | |
plt.hist(r) | |
plt.xlabel("Time of the page load") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment