cleanup for files in scripts/perf
This commit is contained in:
parent
5c7f9b7dc4
commit
b81cbf2a86
8 changed files with 14 additions and 12 deletions
0
scripts/perf/configuration_hook.sh
Normal file → Executable file
0
scripts/perf/configuration_hook.sh
Normal file → Executable file
0
scripts/perf/datacollect_hook.sh
Normal file → Executable file
0
scripts/perf/datacollect_hook.sh
Normal file → Executable file
|
@ -181,7 +181,7 @@ def collectservermems():
|
|||
Return memory (total, free) in KB from proc/meminfo.
|
||||
"""
|
||||
lines = readfile("/proc/meminfo")
|
||||
mem = [x.plit() for x in lines[0:2]]
|
||||
mem = [x.split() for x in lines[0:2]]
|
||||
return [int(x) for x in zip(*mem)[1]]
|
||||
|
||||
|
||||
|
@ -584,6 +584,8 @@ def main():
|
|||
cyclecount = 0
|
||||
while True:
|
||||
cputimea = collectservercputimes()
|
||||
if options.session is not None:
|
||||
nodesa = logsession.getnodemetrics("a")
|
||||
time.sleep(options.interval)
|
||||
cputimeb = collectservercputimes()
|
||||
mems = collectservermems()
|
||||
|
|
4
scripts/perf/perflogstart.sh
Normal file → Executable file
4
scripts/perf/perflogstart.sh
Normal file → Executable file
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# start core performance logging and collect output to file
|
||||
# /tmp/pycore.nnnn/perf<sessionid>.log
|
||||
HOOKS_DIR=`dirname $0`
|
||||
HOOKS_DIR=$(dirname $0)
|
||||
|
||||
sid=` pwd | awk -F / {'print $3'} | awk -F . {'print $2'} `
|
||||
sid=$(pwd | awk -F / {'print $3'} | awk -F . {'print $2'})
|
||||
python $HOOKS_DIR/perflogserver.py -t -a -c /etc/core/perflogserver.conf -s $sid > perf$sid.log &
|
||||
|
|
2
scripts/perf/perflogstop.sh
Normal file → Executable file
2
scripts/perf/perflogstop.sh
Normal file → Executable file
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# terminate core perfromance logging process
|
||||
|
||||
perfproc=` ps aux | grep perflogserver | grep python | awk {'print $2'} `
|
||||
perfproc=$(ps aux | grep perflogserver | grep python | awk {'print $2'})
|
||||
if [ ! $perfproc = "" ]; then
|
||||
echo "terminating core performance log process $perfproc"
|
||||
kill -9 $perfproc
|
||||
|
|
12
scripts/perf/sessiondatacollect.sh
Normal file → Executable file
12
scripts/perf/sessiondatacollect.sh
Normal file → Executable file
|
@ -6,9 +6,9 @@
|
|||
# Collection such runtime tar balls from all distributed servers to folder
|
||||
# /tmp/<sessionid>-<date>-<time> for example: /tmp/56779-11Oct14-09:33:13
|
||||
|
||||
currentdir=` pwd `
|
||||
currentdir=$(pwd)
|
||||
sid=${currentdir##*.}
|
||||
ts=` date +%y%h%d-%T `
|
||||
ts=$(date +%y%h%d-%T)
|
||||
logfile=/tmp/corelog.tgz
|
||||
echo Collect data from localhost:$currentdir to $logfile
|
||||
cd ..
|
||||
|
@ -18,7 +18,7 @@ if [ ! $? = 0 ]; then
|
|||
fi
|
||||
cd $currentdir
|
||||
|
||||
m=` grep master $currentdir/servers `
|
||||
m=$(grep master $currentdir/servers)
|
||||
if [ ! $sid = ${m##*=} ]; then
|
||||
# quite if this is not a master server
|
||||
echo not a master server
|
||||
|
@ -34,13 +34,13 @@ fi
|
|||
cp $logfile $logdir/localhost-${currentdir##*.}.tgz
|
||||
|
||||
# harvest CORE data from distributed servers
|
||||
hs=` grep -v master= $currentdir/servers | awk {'print $2'} `
|
||||
hs=$(grep -v master= $currentdir/servers | awk {'print $2'})
|
||||
echo hosts are localhost $hs
|
||||
for h in $hs; do
|
||||
echo checking host $h ...
|
||||
out=` ping -c 1 -w 1 $h | grep " 0 received," `
|
||||
out=$(ping -c 1 -w 1 $h | grep " 0 received,")
|
||||
if [ " $out " = " " ]; then
|
||||
slavesid=` ssh $h tar -tzf $logfile | awk -F / {'print $1'} `
|
||||
slavesid=$(ssh $h tar -tzf $logfile | awk -F / {'print $1'})
|
||||
if [ $? = 0 ]; then
|
||||
destlogfile=$logdir/$h-${slavesid##*.}.tgz
|
||||
echo Collect data from $h:$logfile to $destlogfile
|
||||
|
|
0
scripts/perf/timesyncstart.sh
Normal file → Executable file
0
scripts/perf/timesyncstart.sh
Normal file → Executable file
4
scripts/perf/timesyncstop.sh
Normal file → Executable file
4
scripts/perf/timesyncstop.sh
Normal file → Executable file
|
@ -18,7 +18,7 @@ if [ -e /usr/sbin/ntpd ]; then
|
|||
# It is not quick enough for our need here
|
||||
/etc/init.d/ntp status
|
||||
if [ $? = 0 ]; then
|
||||
svs=`ntpq -c peers | awk {'print $1'} | grep ^*`
|
||||
svs=$(ntpq -c peers | awk {'print $1'} | grep ^*)
|
||||
if [ "$dbg" = "debug" ]; then
|
||||
ntpq -c peers
|
||||
echo "get time servers for later need: $svs"
|
||||
|
@ -31,7 +31,7 @@ if [ -e /usr/sbin/ntpd ]; then
|
|||
# if there are time servers configured in file /etc/ntp.conf,
|
||||
# adjust time to the first server
|
||||
if [ "$svs" = "" ]; then
|
||||
svs=`grep ^server /etc/ntp.conf | awk {'print $2'} `
|
||||
svs=$(grep ^server /etc/ntp.conf | awk {'print $2'})
|
||||
if [ "$dbg" = "debug" ]; then
|
||||
echo "$svs"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue