X-Git-Url: http://git.pjr.cc/?p=wyse_ntpd.git;a=blobdiff_plain;f=src%2Fgraphit%2Fmake_graphs.php;fp=src%2Fgraphit%2Fmake_graphs.php;h=74c520812253026ecc99112da26820f9515185d5;hp=0000000000000000000000000000000000000000;hb=3015e560eed7f25c176adb07191651e7c1be7db9;hpb=ab0d17fb2d0ea34a5c02596364114dcf31056ce0 diff --git a/src/graphit/make_graphs.php b/src/graphit/make_graphs.php new file mode 100644 index 0000000..74c5208 --- /dev/null +++ b/src/graphit/make_graphs.php @@ -0,0 +1,149 @@ + $val) { + + // first, update all data + $off = $val["offset"]; + $jit = $val["jitter"]; + $ret = rrd_update("all_data.rrd", array("$key:$off:$jit")); + + // if we're previous to 4 hours, update 4hours as well + + if($key < $end_time_4) $ret = rrd_update("first_4_hours.rrd", array("$key:$off:$jit")); +} + + +// do the first four hour graphs +// create first four hours graph of jit +$options = array( +"--start","$time_begin", +"-w","600", +"-h","300", +"-l","-1", +"--end","$end_time_4", +"DEF:4hr_jit=first_4_hours.rrd:jitter:AVERAGE", +"LINE2:4hr_jit#00FF00" +); + +// graph of jit +rrd_graph("4hour_first_jit.png", $options); + +// create first four hours graph of off +$options = array( +"--start","$time_begin", +"-w","600", +"-h","300", +"-l","-1", +"--end","$end_time_4", +"DEF:4hr_jit=first_4_hours.rrd:offset:AVERAGE", +"LINE2:4hr_jit#00FF00" +); + +// graph of offset +rrd_graph("4hour_first_off.png", $options); + + + +$time_last_four = $time_end-(3600*4); + +// do the last four hour graphs +// create first four hours graph of jit +$options = array( +"--start","$time_last_four", +"-w","600", +"-h","300", +"--end","$time_end", +"DEF:4hr_jit=all_data.rrd:jitter:AVERAGE", +"LINE2:4hr_jit#00FF00" +); + +// graph of jit +rrd_graph("4hour_last_jit.png", $options); + +// create first four hours graph of off +$options = array( +"--start","$time_last_four", +"-w","600", +"-h","300", +"--end","$time_end", +"DEF:4hr_jit=all_data.rrd:offset:AVERAGE", +"LINE2:4hr_jit#00FF00" +); + +// graph of offset +rrd_graph("4hour_last_off.png", $options); +?>