bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / support / check_forensic
1 #!/bin/sh
2
3 # check_forensic <forensic log file>
4
5 # check the forensic log for requests that did not complete
6 # output the request log for each one
7
8 F=$1
9
10 temp_create_method=file
11 if test -f `which mktemp`; then
12   temp_create_method=mktemp
13 elif test -f `which tempfile`; then
14   temp_create_method=tempfile
15 fi
16
17 create_temp()
18 {
19   prefix=$1
20   case "$temp_create_method" in
21     file)
22       name="/tmp/$1.$$"
23       ;;
24     mktemp)
25       name=`mktemp -t $1.XXXXXX`
26       ;;
27     tempfile)
28       name=`tempfile --prefix=$1`
29       ;;
30     *)
31       echo "$0: Cannot create temporary file"
32       exit 1
33       ;;
34   esac
35 }
36
37 create_temp fcall
38 all=$name
39 create_temp fcin
40 in=$name
41 create_temp fcout
42 out=$name
43 trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
44
45 cut -f 1 -d '|' $F  > $all
46 grep + < $all | cut -c2- | sort > $in
47 grep -- - < $all | cut -c2- | sort > $out
48
49 # use -i instead of -I for GNU xargs
50 join -v 1 $in $out | xargs -I xx egrep "^\\+xx" $F
51 exit 0