diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-11-23 15:07:56 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-11-23 15:08:03 -0500 |
commit | 028baec8a0de23a0f129370a4894ddc44e552596 (patch) | |
tree | d0424ea14c6955587d1226f6fa6a259fb105eee2 /tools | |
parent | 2e4f631227cd37daeb7edcc178d67e01b7f18690 (diff) | |
download | mongo-028baec8a0de23a0f129370a4894ddc44e552596.tar.gz |
Add support for tracking operation latency in wtperf.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/wtperf.py | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/tools/wtperf.py b/tools/wtperf.py index 3425a1cb504..22e90295187 100644 --- a/tools/wtperf.py +++ b/tools/wtperf.py @@ -47,11 +47,11 @@ if in_ckpt == 'Y': # Write a command file for gnuplot. of = open("gnuplot.cmd", "w") of.write(''' -set terminal png nocrop size 800,600 set autoscale +set datafile sep ',' set grid set style data lines -set datafile sep ',' +set terminal png nocrop size 800,600 set timefmt "%H:%M:%S" set title "wtperf run" set format x "%M:%S" @@ -70,7 +70,61 @@ for start, stop in zip(it, it): of.write(''' set output 'monitor.png' plot "monitor" using 1:($2/100) title "Reads", "monitor" using 1:($3/100) title "Updates", "monitor" using 1:($4/100) title "Inserts"\n''') - of.close() + call(["gnuplot", "gnuplot.cmd"]) os.remove("gnuplot.cmd") + +def plot_latency(name): + # Latency plot: cumulative operations vs. latency + of = open("gnuplot.cmd", "w") + of.write(''' +set autoscale +set datafile sep ',' +set grid +set style data lines +set terminal png nocrop size 800,600 +set title "wtperf %(NAME)s cumulative latency distribution" +set xlabel "Latency (ms)" +set xrange [1:] +set xtics rotate by -45 +set logscale x +set ylabel "%% operations" +set yrange [0:] +set output '%(NAME)s.latency1.png' +plot "latency.%(NAME)s" using 1:(($3 * 100)/$4) title "%(NAME)s"\n''' % { + 'NAME' : name + }) + of.close() + + call(["gnuplot", "gnuplot.cmd"]) + os.remove("gnuplot.cmd") + + # Latency plot: pct operations vs. latency + of = open("gnuplot.cmd", "w") + of.write(''' +set autoscale +set datafile sep ',' +set grid +set style data points +set terminal png nocrop size 800,600 +set title "wtperf %(NAME)s latency distribution" +set xlabel "Latency (ms)" +set xrange [1:] +set xtics rotate by -45 +set logscale x +set ylabel "%% operations" +set yrange [0:] +set output '%(NAME)s.latency2.png' +plot "latency.%(NAME)s" using (($2 * 100)/$4) title "%(NAME)s"\n''' % { + 'NAME' : name + }) + of.close() + + call(["gnuplot", "gnuplot.cmd"]) + os.remove("gnuplot.cmd") + + +plot_latency("insert") +plot_latency("read") +plot_latency("update") |