Mercurial > repos > other > usr-local-bin
annotate load-graph @ 19:e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
Graphing is based on sensors-graph, but recording is a Python script
because more processing is required than logging temperatures.
CPU/GPU recording will hopefully be useful to work out what causes
occasional lags in games - is it just I/O Wait (despite the SSD)?
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 01 Oct 2018 20:52:26 +0100 |
parents | |
children | 31a626c71eab |
rev | line source |
---|---|
19
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 #! /bin/bash |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 start="-6h" |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 if [ $# -eq 1 ] |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 then |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 start=$1 |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 fi |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 rrdtool graph /tmp/load-percent.png -w 1280 -h 1024 -a PNG --start "$start" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 --vertical-label "Usage (%)" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 DEF:core1=$HOME/.load.rrd:core1:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 DEF:core2=$HOME/.load.rrd:core2:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 DEF:core3=$HOME/.load.rrd:core3:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 DEF:core4=$HOME/.load.rrd:core4:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 DEF:CPU=$HOME/.load.rrd:core_avg:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 DEF:GPU=$HOME/.load.rrd:GPU:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 LINE1:core1#99000030:"Core 1" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 LINE1:core2#99000030:"Core 2" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 LINE1:core3#99000030:"Core 3" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 LINE1:core4#99000030:"Core 4" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 LINE2:CPU#990000:"CPU" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 LINE2:GPU#009900:"GPU" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 && rrdtool graph /tmp/load-type.png -w 1280 -h 1024 -a PNG --start "$start" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 --vertical-label "Usage (%)" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 DEF:user=$HOME/.load.rrd:user:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 DEF:system=$HOME/.load.rrd:system:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 DEF:iowait=$HOME/.load.rrd:iowait:AVERAGE \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 AREA:iowait#999999:"I/O Wait" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 STACK:system#000099:"System" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 STACK:user#999900:"User" \ |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 && eog /tmp/load-*.png |
e245a271fc44
Add scripts for recording/displaying CPU and GPU activity
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 rm -f /tmp/load-*.png |