diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2005-11-15 05:46:46 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2005-11-15 05:46:46 +0000 |
commit | 0304704cbef1142c6fff8d483f0c6062fc4a32ae (patch) | |
tree | b80d0602900df0c70fefd5cc226b52d05e03a1a1 | |
parent | 9ac3ba47e66ac3e0f4679d64771e5eb5a0284228 (diff) | |
download | yelp-xsl-0304704cbef1142c6fff8d483f0c6062fc4a32ae.tar.gz |
- 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
-rwxr-xr-x | test/timing/timeall | 42 |
1 files changed, 42 insertions, 0 deletions
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; |