f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Driver script to run resperf and generate an HTML report of
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# the results, with graphs.
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Program locations - change these if not in $PATH
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# The gnuplot terminal type. This determines the image format for the
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# plots; "png" or "gif" will both work as long as the corresponding
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# terminal support is compiled into your copy of gnuplot.
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Create a unique ID for this report
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Set up file names
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Run the test
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt$resperf -P "$plotfile" "$@" >"$outputfile" 2>&1 ||
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt { echo "`basename $0`: error running resperf:" >&2;
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Create plots
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset terminal $terminal
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset output "$rate_graph"
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset title "Query / response / failure rate"
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset key top left
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset xlabel "Time (seconds)"
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset yrange [0:]
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt"$plotfile" using 1:3 title "Queries sent per second" with lines, \
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt"$plotfile" using 1:4 title "Total responses received per second" with lines, \
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt"$plotfile" using 1:5 title "Failure responses received per second" with lines
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt echo "`basename $0`: error running gnuplot" >&2; exit 1;
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset terminal $terminal
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset output "$latency_graph"
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset title "Latency"
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset key top left
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset xlabel "Time (seconds)"
f3ad877eb05befbc862b0233d985758c0caef29aEvan Huntset yrange [0:]
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt"$plotfile" using 1:6 title "Average latency (seconds)" with lines
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt echo "`basename $0`: error running gnuplot" >&2; exit 1;
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt# Generate the report
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt<html><head></head><body>
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt<h1>Resperf report $id</h1>
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt<h2>Resperf output</h2>
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt<h2>Plots</h2>
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt<img src="$rate_graph" />
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt<img src="$latency_graph" />
f3ad877eb05befbc862b0233d985758c0caef29aEvan Hunt</body></html>