- #!/bin/sh
- egrep 'x = "|elapse' > /tmp/foo$$
- awk 'BEGIN { x = 0; y = 0; z = 0; a = 0; }
- /.*elapse.*/ {x = $2 + x; y = $4 + y; z = $6 + z;}
- /.*x = ".*/ {
- printf "query %2d: %7.3f real %7.3f user %7.3f sysn", a, x, y, z;
- x = 0; y = 0; z = 0; a = a + 1; }
- END {printf("query %2d: %7.3f real %7.3f user %7.3f sysn", a, x, y, z);}'
- < /tmp/foo$$