<?php
+$time_lapse_start = 3;
+$time_lapse_end = 24;
+
if(isset($argc)) {
if($argc!=2) {
error_log("Sorry, wrong arguments, need at least the log file name");
// parse the line... oh crap
$lini = preg_split("/ +/", $epl_line);
- $ta[$time]["offset"] = trim($lini[8]);
- $ta[$time]["jitter"] = trim($lini[9]);
+ $ta[$time]["offset"] = trim($lini[8])*1000;
+ $ta[$time]["jitter"] = trim($lini[9])*1000;
$time_end = $time;
echo "RRD Creation problem: ".rrd_error()."\n";
}
-$end_time_4 = $time_begin + (3600*4);
+$end_time_4 = $time_begin + (3600*$time_lapse_start);
foreach($ta as $key => $val) {
"-h","300",
"-l","-1",
"--end","$end_time_4",
-"DEF:4hr_jit=first_4_hours.rrd:jitter:AVERAGE",
-"LINE2:4hr_jit#00FF00"
+"DEF:".$time_lapse_start."hr_jit=first_4_hours.rrd:jitter:AVERAGE",
+"LINE2:".$time_lapse_start."hr_jit#00FF00"
);
// graph of jit
-rrd_graph("4hour_first_jit.png", $options);
+rrd_graph($time_lapse_start."hour_first_jit.png", $options);
// create first four hours graph of off
$options = array(
"--start","$time_begin",
"-w","600",
"-h","300",
-"-l","-1",
+"-l","-1000",
"--end","$end_time_4",
-"DEF:4hr_jit=first_4_hours.rrd:offset:AVERAGE",
-"LINE2:4hr_jit#00FF00"
+"DEF:".$time_lapse_start."hr_jit=first_4_hours.rrd:offset:AVERAGE",
+"LINE2:".$time_lapse_start."hr_jit#00FF00"
);
// graph of offset
-rrd_graph("4hour_first_off.png", $options);
+rrd_graph($time_lapse_start."hour_first_off.png", $options);
-$time_last_four = $time_end-(3600*4);
+$time_last_four = $time_end-(3600*$time_lapse_end);
// do the last four hour graphs
// create first four hours graph of jit
"-w","600",
"-h","300",
"--end","$time_end",
-"DEF:4hr_jit=all_data.rrd:jitter:AVERAGE",
-"LINE2:4hr_jit#00FF00"
+"DEF:".$time_lapse_end."hr_jit=all_data.rrd:jitter:AVERAGE",
+"LINE2:".$time_lapse_end."hr_jit#00FF00"
);
// graph of jit
-rrd_graph("4hour_last_jit.png", $options);
+rrd_graph($time_lapse_end."hour_last_jit.png", $options);
// create first four hours graph of off
$options = array(
"-w","600",
"-h","300",
"--end","$time_end",
-"DEF:4hr_jit=all_data.rrd:offset:AVERAGE",
-"LINE2:4hr_jit#00FF00"
+"DEF:".$time_lapse_end."hr_jit=all_data.rrd:offset:AVERAGE",
+"LINE2:".$time_lapse_end."hr_jit#00FF00"
);
// graph of offset
-rrd_graph("4hour_last_off.png", $options);
+rrd_graph($time_lapse_end."hour_last_off.png", $options);
?>