PDA

View Full Version : Outputting Elapsed Time in HTML


Pyro
07-13-2004, 04:06 PM
In addition to the defaults of Start/Finish time, etc. that are listed in the HTML version of the log, I'd like to add the total elapsed time as well, which appears to be an already created field for me in the .log file itself.

I have edited my .xslt file to include the lines:

<td class="tablehdr">Elapsed</td>

and

<td><xsl:value-of select="status/@elapsed"/></td>

in the Summary area. This works and looks great for every build except the current one, where the table cell is simply blank. And that's all I really care about since I start my log file from scratch every time. Any ideas on how to get that field to show up?

Thanks,
Rob

kinook
07-14-2004, 10:54 PM
The Transform XML Log action does not currently write the elapsed time for the current build when closing the XML log file (it should, and we've put it on the list), and the logging component won't add it until the build has completed (which is too late to get reported on during that build run). The attached sample shows how to write the missing value out after the log file has been closed and generate the HTML report from the modified log file, and it also includes TransformLog2.xlst file with an elapsed time column (LogElapsed.bld expects it to be in your VisBuildPro\Style folder).

Pyro
07-16-2004, 07:26 PM
You'll definitely want to use Int() instead of CInt() in the script step of this build. Int() truncates fractions, where CInt() rounds.

My build was >30 min. and <60 min., so because of the rounding problem, it told me my build was 1 hour, -13 min, -19 sec.

Rob

kinook
07-17-2004, 08:50 AM
You learn something new every day. We've also updated the download with a fix to the Transform XML Log action, so the workaround script is no longer necessary.