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