# How to use ab+gnuplot (invalid command)



## kenorb (Nov 11, 2010)

```
> ab -g blah.txt http://doc/ | tail -n1
Total:        841  841   0.0    841     841
> gnuplot blah.txt 

starttime	seconds	ctime	dtime	ttime	wait
^
"blah.txt", [B]line 1: invalid command[/B]
> gnuplot -h
Usage: gnuplot [OPTION]... [FILE]
for X11 options see 'help X11->command-line-options'
  -V, --version
  -h, --help
  -p  --persist
  -e  "command1; command2; ..."
gnuplot 4.4 patchlevel 0
> man ab | less +/gnuplot-file
       -g gnuplot-file
              Write  all  measured values out as a 'gnuplot' or TSV (Tab sepa-
              rate values) file. This file can easily be imported  into  pack-
              ages  like  Gnuplot,  IDL,  Mathematica, Igor or even Excel. The
              labels are on the first line of the file.
```

Here I see nothing special to set up:
http://www.karlosp.net/blog/2008/06/28/plot-ab-results-with-gnuplot/


----------



## SirDice (Nov 11, 2010)

You're skipping a step.


----------



## kenorb (Nov 11, 2010)

Ok, sorry. I just like to skip the steps, if there are too many

Here are my 3 steps:
[CMD=]ab -n10 -g ab-plot.txt http://localhost/[/CMD]
[CMD=]gnuplot -e 'set terminal png; set output "ab-plot.png"; set xlabel "Request"; set ylabel "ms"; plot "ab-plot.txt" using 10 with lines title "Response time"'[/CMD]
[CMD=]eog ab-plot.png[/CMD]


----------

