In [7]:
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as p
import numpy as np
#%pylab inline
In [8]:
mpl.rcParams.update({'font.size': 14})
golden = (1 + 5 ** 0.5) / 2
colors = ["blue", "#CC0000", "green", "orange"]

def _plot(xs, ys, num=0):
    c = colors[num]
    p.plot(xs, ys, 'o-', markersize=7, color=c)
In [9]:
# Data from fiologparser.py (wip-interval with new implementation of weighted percentiles)
mark_dat = np.genfromtxt("out/clat-073-purepython.log", delimiter=',', skip_header=True, dtype=float)

# Data from fiologparser.py (numpy):
ref_dat = np.genfromtxt("out/clat-073-ref.log", delimiter=',', skip_header=True, dtype=float)

# Data from fiologparser-hist.py:
hist_dat = np.genfromtxt("out/clat-073-hist.log", delimiter=',', skip_header=True, dtype=float)

# Extract columns:
et,ss,mn,avg,med,p90,p95,p99,mx = np.transpose(ref_dat)
hist_et,hist_ss,hist_mn,hist_avg,hist_med,hist_p90,hist_p95,hist_p99,hist_mx = np.transpose(hist_dat)
mark_et,mark_ss,mark_mn,mark_avg,mark_med,mark_p90,mark_p95,mark_p99,mark_mx = np.transpose(mark_dat)

legends = ["fiologparser-stream-numpy", "fiologparser-hist", "fiologparser-purepython"]
In [10]:
p.figure(figsize=(8*golden, 8))
_plot(et, ss)
_plot(et, hist_ss, 1)
_plot(mark_et, mark_ss, 2)
p.legend(legends)
# Number of samples fairly accurate (overestimated for some reason).
# pure python version of fiologparser is missing intervals at the end (green line),
# but is otherwise identical to streaming numpy version:
Out[10]:
<matplotlib.legend.Legend at 0x7f04a34b0be0>
In [11]:
p.figure(figsize=(8*golden, 8))
_plot(et, p90)
_plot(et, hist_p90, 1)
_plot(mark_et, mark_p90, 2)
p.ylim(0,155000)
p.legend(legends)
# Histogramming very accurate compared to individual samples:
Out[11]:
<matplotlib.legend.Legend at 0x7f04a34a6ba8>
In [12]:
def plot_perc(et, ys1, ys2, m_et, m_ys, num, t):
    #subplot(2,3,num) # rows,columns,fignum
    p.figure(figsize=(8*golden, 8))
    _plot(et, ys1),
    _plot(et, ys2, 1)
    _plot(m_et, m_ys, 2)
    p.ylim(0,max(max(m_ys),max(ys1),max(ys2))*1.05)
    p.legend(legends)
    p.title(t)
    #p.show()
plot_perc(et, med, hist_med, mark_et, mark_med, 1, "Median (50th percentile)")
plot_perc(et, p90, hist_p90, mark_et, mark_p90, 2, "90th percentile")
plot_perc(et, p95, hist_p95, mark_et, mark_p95, 3, "95th percentile")
plot_perc(et, p99, hist_p99, mark_et, mark_p99, 4, "99th percentile")
In [13]:
plot_perc(et[2:], mn[2:], hist_mn[2:], mark_et[1:], mark_mn[1:], 4, "min")
plot_perc(et, mx, hist_mx, mark_et, mark_mx, 4, "max")

# Maximums and minimums appear identical:
In [14]:
# Data from osd drop baseline:
osd_drop_dat = np.genfromtxt("out/osd_drop_baseline-10000.log", delimiter=',', skip_header=True, dtype=float)
drop_et,drop_ss,drop_mn,drop_avg,drop_med,drop_p90,drop_p95,drop_p99,drop_mx = np.transpose(osd_drop_dat)
In [15]:
p.figure(figsize=(8*golden, 8))
p.plot(drop_et, drop_p90)
Out[15]:
[<matplotlib.lines.Line2D at 0x7f04a177a320>]
In [ ]: