Skip to content

Commit

Permalink
Nightly summary: Added execution times for 'Make' and 'Configure' stage.
Browse files Browse the repository at this point in the history
  • Loading branch information
karlrupp committed Jan 9, 2014
1 parent 0db60cd commit d342b4a
Showing 1 changed file with 49 additions and 39 deletions.
88 changes: 49 additions & 39 deletions src/contrib/nightlysummary/runhtml.sh
Expand Up @@ -99,6 +99,46 @@ echo "</center>" >> $OUTFILE
echo "<h1>PETSc Test Summary</h1>" >> $OUTFILE
echo "<p>This page is an automated summary of the output generated by the Nightly logs. It provides a quick overview of the test results rather than trying to be a full-fledged testing solution.</p>" >> $OUTFILE

print_timestamp()
{
# Parse start and end time stamps from log file and convert to seconds since begin of that day
starttime_sec=`grep "^Build on\|^Starting on\|^Starting Configure" $f | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\3/'`
starttime_min=`grep "^Build on\|^Starting on\|^Starting Configure" $f | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\2/'`
starttime_hour=`grep "^Build on\|^Starting on\|^Starting Configure" $f | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\1/'`
starttime=$(($((10#$starttime_sec))+$((10#$starttime_min))*60+$((10#$starttime_hour))*3600))

endtime_sec=`grep "Finished Build on\|^Finishing at\|^Finishing Configure" $f | tail -1 | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\3/'`
endtime_min=`grep "Finished Build on\|^Finishing at\|^Finishing Configure" $f | tail -1 | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\2/'`
endtime_hour=`grep "Finished Build on\|^Finishing at\|^Finishing Configure" $f | tail -1 | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\1/'`
endtime=$(($((10#$endtime_sec))+$((10#$endtime_min))*60+$((10#$endtime_hour))*3600))

# Take into account that test might run over midnight or noon
if [ $((starttime)) -gt $((endtime)) ]
then
if [ $starttime_hour -lt 13 ] # check for 12 or 24 hour format
then
endtime=$((endtime+12*3600))
else
endtime=$((endtime+24*3600))
fi
fi

# Compute time taken and print output of the form HH:MM:SS
timetaken=$((endtime - starttime))
timetaken_hour=`printf '%02d' $((10#$timetaken / 3600))`
timetaken_min=`printf '%02d' $(((10#$timetaken - 10#$timetaken_hour * 3600) / 60))`
timetaken_sec=`printf '%02d' $((10#$timetaken - 10#$timetaken_hour * 3600 - 10#$timetaken_min * 60))`

if [ $timetaken -gt 1800 ] #Consider everything longer than 30 minutes to be a lengthy test
then
echo "</td><td class=\"yellow\">$timetaken_hour:$timetaken_min:$timetaken_sec</td></tr>" >> $OUTFILE
else
echo "</td><td class=\"green\">$timetaken_hour:$timetaken_min:$timetaken_sec</td></tr>" >> $OUTFILE
fi
}



# Writes a full result table
# inputs:
# $1 ... Table Title
Expand All @@ -111,7 +151,7 @@ generate_section()
echo "<center><table>" >> $OUTFILE
if [ $3 -gt "0" ]
then
echo "<tr><th>Test</th><th>Warnings</th><th>Errors</th></tr>" >> $OUTFILE
echo "<tr><th>Test</th><th>Warnings</th><th>Errors</th><th>Exec Time</th></tr>" >> $OUTFILE
else
echo "<tr><th>Test</th><th>Possible Problems</th><th>Exec Time</th></tr>" >> $OUTFILE
fi
Expand Down Expand Up @@ -165,9 +205,9 @@ generate_section()
# Write number of errors:
if [ "$filtered_errors_num" -gt "0" ]
then
echo "</td><td class=\"red\">$filtered_errors_num</td></tr>" >> $OUTFILE
echo "</td><td class=\"red\">$filtered_errors_num</td>" >> $OUTFILE
else
echo "</td><td class=\"green\">$filtered_errors_num</td></tr>" >> $OUTFILE
echo "</td><td class=\"green\">$filtered_errors_num</td>" >> $OUTFILE
fi
else # do not count warnings and errors separately, only report possible problems:
possible_problems=`grep -i "Possible problem" $f | wc -l`
Expand All @@ -177,42 +217,10 @@ generate_section()
else
echo "</td><td class=\"green\">$possible_problems</td>" >> $OUTFILE
fi
fi

# Parse start and end time stamps from log file and convert to seconds since begin of that day
starttime_sec=`grep "TESTMODE" $f | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\3/'`
starttime_min=`grep "TESTMODE" $f | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\2/'`
starttime_hour=`grep "TESTMODE" $f | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\1/'`
starttime=$(($((10#$starttime_sec))+$((10#$starttime_min))*60+$((10#$starttime_hour))*3600))

endtime_sec=`grep "Finished Build on" $f | tail -1 | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\3/'`
endtime_min=`grep "Finished Build on" $f | tail -1 | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\2/'`
endtime_hour=`grep "Finished Build on" $f | tail -1 | sed 's/.* \([0-9]*[0-9]\):\([0-9][0-9]\):\([0-9][0-9]\).*/\1/'`
endtime=$(($((10#$endtime_sec))+$((10#$endtime_min))*60+$((10#$endtime_hour))*3600))

# Take into account that test might run over midnight or noon
if [ $((starttime)) -gt $((endtime)) ]
then
if [ $starttime_hour -lt 13 ] # check for 12 or 24 hour format
then
endtime=$((endtime+12*3600))
else
endtime=$((endtime+24*3600))
fi
fi

# Compute time taken and print output of the form HH:MM:SS
timetaken=$((endtime - starttime))
timetaken_hour=`printf '%02d' $((timetaken / 3600))`
timetaken_min=`printf '%02d' $(((timetaken - timetaken_hour * 3600) / 60))`
timetaken_sec=`printf '%02d' $((timetaken - timetaken_hour * 3600 - timetaken_min * 60))`
print_timestamp

if [ $timetaken -gt 1800 ] #Consider everything longer than 30 minutes to be a lengthy test
then
echo "</td><td class=\"yellow\">$timetaken_hour:$timetaken_min:$timetaken_sec</td></tr>" >> $OUTFILE
else
echo "</td><td class=\"green\">$timetaken_hour:$timetaken_min:$timetaken_sec</td></tr>" >> $OUTFILE
fi
fi
done
echo "</table></center>" >> $OUTFILE
}
Expand All @@ -221,7 +229,7 @@ generate_configure_section()
{
echo "<h3>Configure</h3>" >> $OUTFILE
echo "<center><table>" >> $OUTFILE
echo "<tr><th>Configuration</th><th>Status</th></tr>" >> $OUTFILE
echo "<tr><th>Configuration</th><th>Status</th><th>Exec Time</th></tr>" >> $OUTFILE

for f in `ls $LOGDIR/configure_${BRANCH}*.log`
do
Expand All @@ -234,9 +242,11 @@ generate_configure_section()
if [ "$stagecomplete" -gt "0" ]
then
echo "</td><td class=\"green\">Success</td>" >> $OUTFILE
print_timestamp
else
echo "</td><td class=\"red\">Fail</td>" >> $OUTFILE
echo "</td><td class=\"red\">Fail</td><td class=\"red\">Fail</td></tr>" >> $OUTFILE
fi

done
echo "</table></center>" >> $OUTFILE

Expand Down

0 comments on commit d342b4a

Please sign in to comment.