27 lines
535 B
Bash
27 lines
535 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
. ./config.sh
|
||
|
|
||
|
IOR_PARAMS=$1
|
||
|
BENCHFILE=$2
|
||
|
HOST="$hostname"
|
||
|
PID=$$
|
||
|
|
||
|
NETOUTDIR="${BENCHFILE}_network"
|
||
|
NETOUTFILE="$NETOUTDIR/HOST:$HOST#PID:$PID.txt"
|
||
|
|
||
|
[[ ! -d $NETOUTDIR ]] && mkdir $NETOUTDIR || rm $NETOUTDIR/HOST*PID*.txt
|
||
|
|
||
|
function capture_network_state {
|
||
|
label=$1
|
||
|
echo "LABEL $label"
|
||
|
echo "TIMESTAMP $(date +%s)"
|
||
|
perfquery -x
|
||
|
cat /proc/net/dev
|
||
|
}
|
||
|
|
||
|
echo "" > $NETOUTFILE
|
||
|
echo "$( capture_network_state "START" )" &>> $NETOUTFILE
|
||
|
$IOR $IOR_PARAMS
|
||
|
echo "$( capture_network_state "STOP" )" &>> $NETOUTFILE
|