-
Notifications
You must be signed in to change notification settings - Fork 23
/
startStatmonitor
executable file
·53 lines (42 loc) · 1.3 KB
/
startStatmonitor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/bash
#=========================================================================
# Copyright (c) 2014, 2015 GemTalk Systems, LLC <dhenrich@gemtalksystems.com>.
#=========================================================================
echo "================="
echo " GsDevKit script: $(basename $0) $*"
echo "================="
usage() {
cat <<HELP
USAGE: $(basename $0) [-h] <stone-name>
Start statmonitor for the given stone. Two statmonitors are
started. One that collects a sample every second and is
restarted every hour. One that collects a sample once a
minute and is restarted once a day.
OPTIONS
-h display help
EXAMPLES
$(basename $0) -h
$(basename $0) kit
HELP
}
set -e # exit on error
if [ "${GS_HOME}x" = "x" ] ; then
echo "the GS_HOME environment variable needs to be defined"; exit 1
fi
source ${GS_HOME}/bin/shFunctions
getOpts_help $@
if [ $# -ne 1 ]; then
usage; exit 1
fi
stoneName=$1
# set up stone environment
stonePath=$GS_HOME/gemstone/stones/$stoneName
pushd $stonePath >& /dev/null
source $stonePath/stone.env
popd >& /dev/null
# start the statmonitors
cd $stonePath/stats/1-second
$stonePath/product/bin/statmonitor $stoneName -Arzq -h 1 -i 1 -u 0 &
cd ../60-second
$stonePath/product/bin/statmonitor $stoneName -Arzq -h 24 -i 60 -u 0 &
echo "...finished $(basename $0)"