include factor in timing report;
authorwenzelm
Thu, 02 Oct 2008 22:09:22 +0200
changeset 28467 c8336c42668e
parent 28466 6e35fbfc32b8
child 28468 7c80ab57f56d
include factor in timing report;
Admin/isatest/isatest-statistics
lib/scripts/timestop.bash
--- a/Admin/isatest/isatest-statistics	Thu Oct 02 21:21:21 2008 +0200
+++ b/Admin/isatest/isatest-statistics	Thu Oct 02 22:09:22 2008 +0200
@@ -79,7 +79,7 @@
   $(find "$LOG_DIR" -name "$LOG_NAME" -ctime "-${TIMESPAN}") | \
 perl -e '
   while (<>) {
-    if (m/(\d\d\d\d)-(\d\d)-(\d\d).*:Finished (\S+) \((\d+):(\d+):(\d+) elapsed time, (\d+):(\d+):(\d+) cpu time\)/) {
+    if (m/(\d\d\d\d)-(\d\d)-(\d\d).*:Finished (\S+) \((\d+):(\d+):(\d+) elapsed time, (\d+):(\d+):(\d+) cpu time/) {
         my $year = $1;
         my $month = $2;
         my $day = $3;
--- a/lib/scripts/timestop.bash	Thu Oct 02 21:21:21 2008 +0200
+++ b/lib/scripts/timestop.bash	Thu Oct 02 22:09:22 2008 +0200
@@ -12,18 +12,22 @@
   local TIMES_START="$TIMES_RESULT"
   get_times
   local TIMES_STOP="$TIMES_RESULT"
+  local TIME1
+  local TIME2
   local KIND
   for KIND in 1 2
   do
     local START=$(echo "$TIMES_START" | cut -d " " -f $KIND)
     local STOP=$(echo "$TIMES_STOP" | cut -d " " -f $KIND)
 
-    local TIME=$[ $STOP - $START ]
-    local SECS=$[ $TIME % 60 ]
+    local TIME=$(( $STOP - $START ))
+    eval "TIME${KIND}=$TIME"
+
+    local SECS=$(( $TIME % 60 ))
     [ $SECS -lt 10 ] && SECS="0$SECS"
-    local MINUTES=$[ ($TIME / 60) % 60 ]
+    local MINUTES=$(( ($TIME / 60) % 60 ))
     [ $MINUTES -lt 10 ] && MINUTES="0$MINUTES"
-    local HOURS=$[ $TIME / 3600 ]
+    local HOURS=$(( $TIME / 3600 ))
 
     local KIND_NAME
     [ "$KIND" = 1 ] && KIND_NAME="elapsed time"
@@ -36,6 +40,13 @@
       TIMES_REPORT="$TIMES_REPORT, $RESULT"
     fi
   done
+  if let "$TIME1 >= 5 && $TIME2 >= 5"
+  then
+    local FACTOR=$(( $TIME2 * 10 / $TIME1 ))
+    local FACTOR1=$(( $FACTOR / 10 ))
+    local FACTOR2=$(( $FACTOR % 10 ))
+    TIMES_REPORT="$TIMES_REPORT, factor ${FACTOR1}.${FACTOR2}"
+  fi
 }
 
 show_times  # sets TIMES_REPORT