changeset 24:2576b5cfb71c

Add an "end" parameter to performance chart plotting Without this we can't plot sub-sets of older data files
author IBBoard <dev@ibboard.co.uk>
date Sun, 09 Jun 2019 15:55:46 +0100
parents 489ba6ea3c35
children b9e808b6b01e
files load-graph
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/load-graph	Sun Jun 09 15:53:48 2019 +0100
+++ b/load-graph	Sun Jun 09 15:55:46 2019 +0100
@@ -1,13 +1,18 @@
 #! /bin/bash
 
 start="-6h"
+end="0"
 
 if [ $# -eq 1 ]
 then
 	start=$1
+elif [ $# -eq 2 ]
+then
+	start=$1
+	end=$2
 fi
 
-rrdtool graph /tmp/load-percent.png -w 1280 -h 1024 -a PNG --start "$start" \
+rrdtool graph /tmp/load-percent.png -w 1280 -h 1024 -a PNG --start "$start" --end "$end" \
 	--vertical-label "Usage (%)" \
 	DEF:core1=$HOME/.load.rrd:core1:AVERAGE \
 	DEF:core2=$HOME/.load.rrd:core2:AVERAGE \
@@ -21,7 +26,7 @@
 	LINE1:core4#99000030:"Core 4" \
 	LINE2:CPU#990000:"CPU" \
 	LINE2:GPU#009900:"GPU" \
-&& rrdtool graph /tmp/load-type.png -w 1280 -h 1024 -a PNG --start "$start" \
+&& rrdtool graph /tmp/load-type.png -w 1280 -h 1024 -a PNG --start "$start" --end "$end" \
 	--vertical-label "Usage (%)" \
 	DEF:user=$HOME/.load.rrd:user:AVERAGE \
 	DEF:system=$HOME/.load.rrd:system:AVERAGE \