From 0304704cbef1142c6fff8d483f0c6062fc4a32ae Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Tue, 15 Nov 2005 05:46:46 +0000 Subject: - New script to time the DocBook XSLT across all installed docs * test/timing/timeall: - New script to time the DocBook XSLT across all installed docs --- test/timing/timeall | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 test/timing/timeall (limited to 'test') diff --git a/test/timing/timeall b/test/timing/timeall new file mode 100755 index 00000000..1bfc354c --- /dev/null +++ b/test/timing/timeall @@ -0,0 +1,42 @@ +#!/bin/sh + +helpdir="/usr/share/gnome/help/"; + +title=$1 +if [ "x$title" = "x" ]; then + echo "You must specify a title for the timing run."; + exit 1; +fi; + +mkdir -p "$title"; +mkdir -p "$title/_LOGS"; +rm -f "$title.times" && touch "$title.times" + +for doc in `ls $helpdir`; do + docdir="$helpdir$doc"; + if [ -d "$docdir" ]; then + for lang in `ls $docdir`; do + langdir="$docdir/$lang"; + if [ -d "$langdir" ]; then + docfile="$langdir/$doc.xml"; + outdir="$title/$doc/$lang"; + outfile="$outdir/$doc.xhtml"; + logfile="$title/_LOGS/$doc.$lang.out"; + mkdir -p "$outdir"; + rm -f "$logfile" && touch "$logfile"; + for i in 1 2 3 4 5; do + xsltproc --timing \ + --stringparam "db.chunk.basename" "$doc" \ + -o "$outfile" \ + ../../xslt/docbook/html/db2html.xsl \ + "$docfile" 2>> $logfile; + done; + times=`grep 'Running stylesheet and saving result took' \ + "$logfile" | cut -d' ' -f7 - | sed -e 's/$/+/g'`; + total=`echo $times 0 | bc`; + avg=`echo $total / 5 | bc`; + echo "$doc/$lang $avg" >> "$title.times"; + fi; + done; + fi; +done; -- cgit v1.2.1