echo "<h2>Simulation logs</h2>"
echo "<table border=\"1\" cellpadding=\"5\" cellspacing=\"2\" width=\"100%\">"
-echo "<thead><tr><th>Test</th><th width=\"12%\">Dedicated<br>core(s)</th><th width=\"12%\">Load<br>(%)</th><th>Start date</th><th>End date</th></tr></thead>"
+echo "<thead><tr><th>Test</th><th>Dedicated<br>core(s)</th><th>Load<br>(%)</th><th>Duration<br>(s)</th></tr></thead>"
echo "<tbody>"
#!/usr/bin/awk -f
+function searchdate(line, str) {
+ str = gensub(/.* ([0-9][0-9]:[0-9][0-9]:[0-9][0-9]) .*/, "\\1", "g")
+ gsub(/:/, ")*60+", str)
+ return "(((" str ")"
+}
+
+function eval(str, cmd, nb) {
+ cmd = "awk \"BEGIN { printf " str "}\""
+ cmd | getline nb
+ close(cmd)
+ return nb
+}
+
BEGIN {
OFS=","
if (!nohead) {
- print "Test", "Dedicated core(s)", "Load (%)", "Start date", "End date"
+ print "Test", "Dedicated core(s)", "Load (%)", "Duration (s)"
}
start = ""
}
/CPU load/ { load=$3 }
/UTC/ {
+ time = searchdate($0)
if (start == "") {
- start = $0
+ start = time
} else {
- print test, dcore, load, start, $0
+ print test, dcore, load, eval(time "-" start)
start = ""
}
}