git.iko.soy/typeable/pandoc
on master help sign in
Added stats.sh, to make it easier to collect benchmark & loc info.
commit137dc85239e0112352811b774d9d7cf6a57ddc83 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 22 Dec 2010, 14:13 (16 years ago) parentdc597a8
1 file changed+33
stats.sh+33
stats.shnew file+33
@@ -0,0 +1,33 @@
1+#!/bin/sh
2+
3+# Generates statistics on pandoc: benchmarks and lines of code
4+# The stats are put in the stats directory, marked with date and revision hash.
5+
6+STATSDIR=stats
7+mkdir $STATSDIR
8+
9+DATE=`date +%Y_%m_%d`
10+REV=`git rev-parse --short HEAD`
11+
12+EXT=$DATE.$REV
13+BENCH=$STATSDIR/benchmark.$EXT
14+LOC=$STATSDIR/loc.$EXT
15+SUMMARY=$STATSDIR/summary.$EXT
16+
17+runghc Benchmark.hs > $BENCH
18+find src -name '*.hs' | xargs wc -l > $LOC
19+
20+LOCSUM=`tail -1 $LOC | sed -Ee 's/^ *([0-9]+).*/\1/'`
21+
22+echo "Revision $REV" > $SUMMARY
23+echo `date` >> $SUMMARY
24+echo "$LOCSUM lines of code" >> $SUMMARY
25+echo "" >> $SUMMARY
26+
27+sed -nEe '/^(benchmarking|mean:)/p' $BENCH | \
28+ sed -Ee '/benchmarking/N;s/\n/: /' | \
29+ sed -Ee 's/benchmarking (.*)/\1/' | \
30+ sed -Ee 's/mean: ([^ ]*) *([^,]*).*/\1:\2/' | \
31+ awk 'BEGIN { FS = ": *" } ; { printf("%s:%7.2f %s\n", $1, $2, $3); }' | \
32+ column -t -s ":" >> $SUMMARY
33+