Last active
August 29, 2015 14:16
-
-
Save aminamid/3676402e09430404e198 to your computer and use it in GitHub Desktop.
performance information of host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATESTR=`date "+%Y%m%d%H%M%S"` | |
INTERVAL=3 | |
DURATION=10 | |
OUTDIR=/tmp/pss$DATESTR | |
TARGETS="java influxd" | |
function pgreps() { echo $(for target in $@ ; do pgrep $target; done); return 0; } | |
mkdir $OUTDIR | |
for pid in $(pgreps $TARGETS) ; | |
do while true; do gstack $pid ; sleep $INTERVAL; done | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' >> $OUTDIR/gsta.$pid & | |
done | |
netstat -s $INTERVAL | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/snet & | |
netstat -ntoape $INTERVAL | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/net & | |
vmstat $INTERVAL 65535 | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/vms & | |
iostat -xdN -j PATH $INTERVAL | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/io & | |
sar -A -o $OUTDIR/sb $INTERVAL 65535 & | |
#pidstat -t -u -p ALL $INTERVAL 65535 | grep --line-buffered -v -e " 0.00 0.00 0.00 0.00 " > $OUTDIR/pcpu & | |
#pidstat -d -p ALL $INTERVAL 65535 | grep --line-buffered -v -e " 0.00 0.00 0.00 " > $OUTDIR/pio & | |
pidstat -h -w -u -d -t -p ALL $INTERVAL 65535 | grep -v -e " 0.00 0.00 0.00 0.00 .* \( 0\|-1\).00 \( 0\|-1\).00 \( 0\|-1\).00 0.00 0.00 " > $OUTDIR/pidstat & | |
sleep $DURATION | |
jobs -p | xargs kill | |
#!/bin/bash | |
DATESTR=`date "+%Y%m%d%H%M%S"` | |
INTERVAL=2 | |
DURATION=10 | |
OUTDIR=/tmp/pss$DATESTR | |
TARGETS="bash sshd" | |
function pgreps() { echo $(for target in $@ ; do pgrep $target; done); return 0; } | |
mkdir $OUTDIR | |
for pid in $(pgreps $TARGETS) ; | |
do while true; do gstack $pid ; sleep $INTERVAL; done | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/gsta.$pid & | |
done | |
netstat -s $INTERVAL | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/snet & | |
netstat -ntoape $INTERVAL | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/net & | |
vmstat $INTERVAL 65535 | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/vms & | |
iostat -xdN -j PATH $INTERVAL | awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/io & | |
top -Hbd $INTERVAL | awk '{$1=$1; print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush() }' > $OUTDIR/top & | |
sar -A -o $OUTDIR/sb $INTERVAL 65535 & | |
pidstat -I -u -t -d -p ALL ${INTERVAL} 65535 | grep --line-buffered -v -e " 0.00 0.00 0.00 " -e " 0.00 0.00 0.00 0.00 " > $OUTDIR/pidstat & | |
sleep $DURATION | |
jobs -p | xargs kill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment