| author | Tomas Zeman <tzeman@volny.cz> |
| Wed, 10 Aug 2011 10:24:57 +0200 | |
| changeset 14 | f4d75fcc72a3 |
| 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'}'