This repository has been archived on 2026-05-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
disco/universe/bin/disco-ball

150 lines
5.0 KiB
Plaintext
Raw Normal View History

#!/bin/bash
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
TIME="time_real %e : time_user %U : time_sys %S\nmem_avg %K : mem_max %M : mem_faults_major %F : mem_faults_minor %R\nio_fsin %I : io_fsout %O : io_sockin %r : io_sockout %s : io_signals %k\nexit: %x"
DISCOROOT=/var/disco
RSYNC=$(disco-param get disco/client/cmds/rsync || exit 1)
SERVERURI=$(disco-param get disco/server/uri || exit 1)
STORAGE=$(disco-param get disco/client/storage 2>/dev/null || echo "/var/disco/localstore")
mkdir -p ${STORAGE}
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
mkdir -p ${DISCOROOT}/reports/_internal
function init() {
if [ "$1" == "" ]; then
echo "Must enter a path to initialize" >&2
return 1
fi
mkdir -p $1/templates
mkdir -p $1/scripts
mkdir -p $1/files
touch $1/requires
mkdir -p $1/parameters/$(basename $1)
}
function fetch_params() {
# Sometimes there's some shell escaping voodoo and rsync doesn't like the command args some people will pass it straight on
# the command line; so we wrap it in a little bash script, and everyone's happy.
echo ${RSYNC} --delete ${SERVERURI}::parameters/$(hostname)/* ${DISCOROOT}/parameters/$(hostname)/ > /tmp/$$.sh
echo 'exit $?' >> /tmp/$$.sh
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
/usr/bin/time -f "$TIME" -o ${DISCOROOT}/reports/_internal/fetch_params /bin/bash /tmp/$$.sh
RETVAL=$?
rm -f /tmp/$$.sh
return $RETVAL
}
function fetch() {
if [ "$1" == "" ]; then
echo "Must pass a module name to fetch"
return 1
fi
if [ "$NOOP" == "" ]; then
DEST=/var/disco/testfs/real/scratchfs
else
DEST=/var/disco/testfs/noop/scratchfs
fi
rm -rf ${STORAGE}/${1}
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
mkdir -p ${DISCOROOT}/reports/$1
rm -f ${DISCOROOT}/reports/${1}/fetch
# Sometimes there's some shell escaping voodoo and rsync doesn't like the command args some people will pass it straight on
# the command line; so we wrap it in a little bash script, and everyone's happy.
echo ${RSYNC} ${SERVERURI}::${1}/files/* ${DEST} > /tmp/$$.sh
echo ${RSYNC} --delete ${SERVERURI}::${1}/requires ${SERVERURI}::${1}/scripts ${SERVERURI}::${1}/parameters ${SERVERURI}::${1}/templates ${STORAGE}/${1} >> /tmp/$$.sh
echo 'exit $?' >> /tmp/$$.sh
/usr/bin/time -f "$TIME" -o ${DISCOROOT}/reports/${1}/fetch /tmp/$$.sh 2>/tmp/$$.errors | sed s/"^"/"info: ${1}: "/g
cat /tmp/$$.errors | grep -v "some files/attrs were not transferred" | sed s/"^"/"error: ${1}: "/g
RETVAL=$?
rm -f /tmp/$$.sh
return $RETVAL
}
function requires()
{
if [ "$1" == "" ]; then
echo "Must pass a module name for requirements"
return 1
fi
cat ${STORAGE}/${1}/requires | sed s/"^"/"${1} "/g
}
function exec() {
RETVAL=0
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
mkdir -p ${DISCOROOT}/reports/$1
rm -f ${DISCOROOT}/reports/${1}/exec
for file in $(find ${STORAGE}/${1}/scripts/ -type f | sort -u)
do
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
NOOP="$NOOP" /usr/bin/time -f "$TIME" -o /tmp/$$.exec.time disco-sh-exec $file /tmp/${1}-$(basename $file)
RETVAL=$(expr $RETVAL + $?)
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
SNAME=$(basename $file)
echo "$SNAME : " >> ${DISCOROOT}/reports/${1}/exec
cat /tmp/$$.exec.time | sed s/"^"/" "/g >> ${DISCOROOT}/reports/${1}/exec
done
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
rm -f /tmp/$$.exec.time
return $RETVAL
}
function template() {
if [ "$1" == "" ]; then
echo "Must pass a module name to template"
return 1
fi
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
mkdir -p ${DISCOROOT}/reports/$1
rm -f ${DISCOROOT}/reports/${1}/template
DESTROOT=""
if [ "$NOOP" != "" ]; then
DESTROOT=/var/disco/testfs/noop/scratchfs
fi
if [ ! -d ${STORAGE}/${1}/templates ]; then
return 0;
fi
cd ${STORAGE}/${1}/templates
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
RETVAL=0
for file in $(find . -type f | sed s/"^\.\/"//g)
do
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
NOOP=true /usr/bin/time -f "$TIME" -o /tmp/$$.template.time disco-sh-exec $(pwd)/$file /$file >/tmp/$$.tmpl
echo "$file : " >> ${DISCOROOT}/reports/${1}/template
cat /tmp/$$.template.time | sed s/"^"/" "/g >> ${DISCOROOT}/reports/${1}/template
if [ $? -eq 0 ]; then
mkdir -p $(dirname ${DESTROOT}/$file)
mv /tmp/$$.tmpl ${DESTROOT}/$file
else
echo "error: template ${1}/templates/$file failed, not replacing /$file"
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
RETVAL=1
fi
done
Added builtin performance metrics. Add REPORT=true to one of your disco dance runs to print the report at the end, or use 'disco report' to produce a report on the last disco dance; reports are cleared at the beginning of every disco dance. _internal diff is for the time taken to produce the filesystem diff _internal fetch_params is for how long it took to fetch all the client parameters Currently these performance numbers only account for about 50-70% of disco's activity, not sure how to report on the rest yet. Example output: report: _internal: diff report: time_real 1.15 : time_user 0.21 : time_sys 0.92 report: mem_avg 0 : mem_max 4816 : mem_faults_major 0 : mem_faults_minor 25400 report: io_fsin 0 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: _internal: fetch_params report: time_real 1.14 : time_user 0.03 : time_sys 0.07 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 1674 report: io_fsin 0 : io_fsout 0 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: fetch report: time_real 2.27 : time_user 0.06 : time_sys 0.13 report: mem_avg 0 : mem_max 11136 : mem_faults_major 0 : mem_faults_minor 2842 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: othermodule-3.2: template report: etc/othermodule/stuff.cfg : report: time_real 0.53 : time_user 0.03 : time_sys 0.35 report: mem_avg 0 : mem_max 4656 : mem_faults_major 119 : mem_faults_minor 5086 report: io_fsin 25408 : io_fsout 16 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: exec report: 00-hello.sh : report: time_real 0.29 : time_user 0.03 : time_sys 0.20 report: mem_avg 0 : mem_max 4592 : mem_faults_major 54 : mem_faults_minor 3871 report: io_fsin 10992 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: 10-service_stop.sh : report: time_real 0.46 : time_user 0.03 : time_sys 0.32 report: mem_avg 0 : mem_max 4592 : mem_faults_major 110 : mem_faults_minor 4564 report: io_fsin 22328 : io_fsout 8 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0 report: testmodule-1.0: fetch report: time_real 2.24 : time_user 0.05 : time_sys 0.13 report: mem_avg 0 : mem_max 11152 : mem_faults_major 0 : mem_faults_minor 2894 report: io_fsin 0 : io_fsout 24 : io_sockin 0 : io_sockout 0 : io_signals 0 report: exit: 0
2012-08-17 20:46:57 -04:00
rm -f /tmp/$$.template.time
return $RETVAL
}
function spin() {
module=$1
echo "info: Processing ${module}"
NOOP="true" template $module
if [ "$NOOP" == "" ]; then
# We rsync all the configs and files into the 'real' scratchfs so that we can
# just do one big diff at the very end, capturing every single disk change,
# including ones made by the scripts.
rsync -aWH /var/disco/testfs/noop/scratchfs/. /var/disco/testfs/real/scratchfs/
fi
NOOP="$NOOP" exec $module
RETVAL=$?
/usr/bin/time -f "$TIME" -o /var/disco/reports/${module}/diff disco-fs-diff
if [ "$NOOP" == "" ]; then
# Now for the real rsync back home
2012-08-23 18:59:44 -04:00
cd /var/disco/testfs/real/scratchfs/.unionfs
for file in $(find . -iname "*_HIDDEN~" | sed -e s/"^\."/""/g -e s/"_HIDDEN~$"/""/g);
2012-08-23 18:59:44 -04:00
do
rm -rf /${file}
done
cd ..
rm -rf ./.unionfs
rsync -aWH /var/disco/testfs/real/scratchfs/. /
fi
rm -rf /var/disco/testfs/noop/scratchfs/*
rm -rf /var/disco/testfs/real/scratchfs/*
if [ $RETVAL -ne 0 ]; then
echo "error: Failed to apply $module."
fi
return $?
}
$1 $2