Skip to content

Instantly share code, notes, and snippets.

@ivan3bx
Created April 1, 2021 17:11
Show Gist options
  • Save ivan3bx/1a8375060b925391e7cc49376a7208f7 to your computer and use it in GitHub Desktop.
Save ivan3bx/1a8375060b925391e7cc49376a7208f7 to your computer and use it in GitHub Desktop.
Plotting response time from Apache Bench..
# define output file as variable (with default)
if (!exists("outfile")) outfile='output.png'
# define input file as variable (with default)
if (!exists("infile")) infile='values.tsv'
# set output format & size
set terminal png size 1024,768 crop
# set output filename (see 'outfile' variable)
set output outfile
# graph title
set title "My results"
# set aspect ratio
set size 1,0.75
# y-axis (grid + label)
set grid y
set ylabel "Response time \(ms\)"
# x-axis (label only)
set xlabel "Time"
# y-axis range
set yrange [0:500]
# x-series will base off time
set xdata time
# x-series time *input* format (seconds)
set timefmt "%s"
# x-series time *output* format for tic marks
set format x ""
# point size
set pointsize 2
# plot data (using 'infile' variable)
# ::2 will skip the header (line 1)
plot "/work/".infile every ::2 using 6:9 smooth sbezier with lines title "x"
@ivan3bx
Copy link
Author

ivan3bx commented Apr 1, 2021

Data was generated w/ ab -c 1 -n 5000 -t 10 -g input.tsv http://127.0.0.1:7777/

out_exp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment