| 1 | <html><h1>sar-cpu</h1><img src="sar-cpu.gif"><p> |
| 2 | <a href="gall.using.html">How to download and try this example</a><br> |
| 3 | <pre><b> |
| 4 | // Plot CPU utilization data as produced by sar(1) utility. |
| 5 | // Contributed by Pablo Marques ([email protected]) |
| 6 | |
| 7 | // Usage: pl -gif sar-cpu.htm |
| 8 | // Uses the data file <a href="sar-cpu.dat">sar-cpu.dat</a> |
| 9 | <hr></b> |
| 10 | |
| 11 | #proc page |
| 12 | #if @DEVICE in png,gif |
| 13 | scale: 0.6 |
| 14 | #endif |
| 15 | |
| 16 | #proc getdata |
| 17 | file: sar-cpu.dat |
| 18 | fieldnames: time usr sys wio idle |
| 19 | |
| 20 | #proc areadef |
| 21 | title: % CPU Utilization |
| 22 | titledetails: size=14 align=C |
| 23 | rectangle: 1 1 8 4 |
| 24 | xscaletype: time hh:mm:ss |
| 25 | xrange: 00:00:00 23:59:59 |
| 26 | yrange: 0 100 |
| 27 | |
| 28 | #proc xaxis |
| 29 | stubs: inc 2 hours |
| 30 | minorticinc: 30 minutes |
| 31 | stubformat: hhA |
| 32 | |
| 33 | |
| 34 | #proc yaxis |
| 35 | stubs: inc 10 |
| 36 | // grid: color=orange |
| 37 | gridskip: min |
| 38 | ticincrement: 100 1000 |
| 39 | |
| 40 | #proc curvefit |
| 41 | xfield: time |
| 42 | yfield: wio |
| 43 | linedetails: color=blue width=.5 |
| 44 | legendlabel: wio |
| 45 | |
| 46 | #proc curvefit |
| 47 | xfield: time |
| 48 | yfield: sys |
| 49 | linedetails: color=red width=.5 |
| 50 | legendlabel: sys |
| 51 | |
| 52 | #proc curvefit |
| 53 | xfield: time |
| 54 | yfield: usr |
| 55 | linedetails: color=green width=.5 |
| 56 | legendlabel: usr |
| 57 | |
| 58 | #proc legend |
| 59 | location: max-1 max |
| 60 | seglen: 0.2 |