dotplan

troubleshooting & performance analysis

Changing the implicit x axis in time-series plots.

Tags:

Quite often I’ll be plotting out values from some kernel counter or other, that has been collected over time. Typically what we want to then do is to plot that counters’ value over time.

In such a case, I typically have a plot command that looks like this

gnuplot>  plot "somefile.out" using 3 with lines

Gnuplot will then autogenerate an x coordinate for me, and the value will start at 1 and increase with each line that is plot.

Let’s pretend that each statistic is collected at a 3 hour interval over many days, and I want to present the chart with days as the metric.

I can do that using the $0 value, which in this case is the implicit x coordinate. I can do something like this.

gnuplot> plot "somefile.out using (($0*3)/24):3 with lines

Use “every” keyword to skip over table preamble.

Tags:

So, it’s often the case that I’ll want to use gnuplot to make a plot of some data inside a file, which takes the format of a report. Typically there will be some preamble, a description of the columns or whatever, followed by the table that we’re interested in.

For example, I want to plot the data in a file that looks a little like this. Actually a lot like this.


 42 Run warming up at 0.269 seconds
 43 Run starting at 600.276 seconds
 44 Stopping on signal 15
 45 Run ramp down at 11074.376 seconds
 46 Run finished at 11075.936 seconds
 47
 48 IOPs: 2999.07
 49         I/Os during measurement: 31412590
 50                 Reads: 12389229
 51                 Writes: 19023361
 52         Run Length: 10474.100 seconds
 53
 54
 55 SPC-1 comparison data.  Invalid if response time > 30mS.
 56 May not be predictive of real SPC-1 latency.  NetApp Confidential.
 57             invl      i/o    resp    resp    read   write fifo
 58                      rate    time     max    time    time time
 59 08:24:52.867   1  3004.07   12.11  192.10   28.01    1.74    2.73
 60 08:25:52.767   2  2997.96   12.79  138.44   29.86    1.78    0.92
 61 08:26:52.667   3  3006.04   13.59  207.66   31.36    2.01    2.59
 62 08:27:52.567   4  2938.61   15.23  202.14   35.35    2.09   56.50
 63 08:28:52.467   5  3050.85   23.16  216.12   53.91    3.15  292.74
 64 08:29:52.367   6  2994.54   24.10  223.62   56.14    3.28  301.11

The first column here is just the line number from within vim. So, anyway, I know that my table starts on line 59. In gnuplot, I then use the ‘every’ command to skip to line 59, then plot the fourth column of every row thereafter.

gnuplot> plot "data.out.29" using 4 every 1::59 w lp t "29, Avg Response time"

© 2009 dotplan. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.