| author | Tomas Zeman <tzeman@volny.cz> |
| Tue, 27 Dec 2011 10:22:09 +0100 | |
| changeset 18 | 01a815c167f5 |
| parent 11 | ab5293025139 |
| permissions | -rwxr-xr-x |
#!/bin/sh # Companion to jvm-stat-make to obtain actual value from dumped statistics. # Invocation: # jvm-jstat-get <name> <stat> <field> # where name is symbolic name (service name etc.), # stat is statistic name (stats file) and # field number (from 1) to be returned if [ -z "$1" -o -z "$2" -o -z "$3" ]; then echo -e "Missing service name, stat or field" exit 1 fi UID=`id -u` N=$1 STAT=$2 FIELD=$3 D=/tmp/jvm-jstat-$UID-$N [ -d $D ] || exit 1; tail -1 $D/$STAT | awk '{print $'$FIELD'}'