[CalendarServer-changes] [6582] CalendarServer/trunk/contrib/performance
source_changes at macosforge.org
source_changes at macosforge.org
Tue Nov 9 16:18:10 PST 2010
Revision: 6582
http://trac.macosforge.org/projects/calendarserver/changeset/6582
Author: exarkun at twistedmatrix.com
Date: 2010-11-09 16:18:07 -0800 (Tue, 09 Nov 2010)
Log Message:
-----------
Add a script for generating profile data from the benchmarks
Modified Paths:
--------------
CalendarServer/trunk/contrib/performance/sample.sh
Added Paths:
-----------
CalendarServer/trunk/contrib/performance/benchlib.sh
CalendarServer/trunk/contrib/performance/profile.sh
Added: CalendarServer/trunk/contrib/performance/benchlib.sh
===================================================================
--- CalendarServer/trunk/contrib/performance/benchlib.sh (rev 0)
+++ CalendarServer/trunk/contrib/performance/benchlib.sh 2010-11-10 00:18:07 UTC (rev 6582)
@@ -0,0 +1,45 @@
+
+set -e # Break on error
+shopt -s nullglob # Expand foo* to nothing if nothing matches
+
+BACKENDS="filesystem postgresql"
+
+SOURCE=~/Projects/CalendarServer/trunk
+BENCHMARKS="event_move event_delete_attendee event_add_attendee event_change_date event_change_summary event_delete vfreebusy event"
+STATISTICS=(HTTP SQL read write pagein pageout)
+ADDURL=http://boson.:8000/result/add/
+
+function setbackend() {
+ ./setbackend $SOURCE/conf/caldavd-test.plist $1 > $SOURCE/conf/caldavd-dev.plist
+}
+
+function update_and_build() {
+ pushd $SOURCE
+ stop
+ svn st --no-ignore | grep '^[?I]' | cut -c9- | xargs rm -r
+ svn up -r$1 .
+ python setup.py build_ext -i
+ popd
+}
+
+function start() {
+ NUM_INSTANCES=$1
+ shift
+ ./run -d -n $*
+ while :; do
+ instances=($SOURCE/data/Logs/*instance*)
+ if [ "${#instances[*]}" -ne "$NUM_INSTANCES" ]; then
+ sleep 2
+ else
+ break
+ fi
+ done
+}
+
+function stop() {
+ ./run -k || true
+ while [ -e ./data/Logs/caldavd.pid ]; do
+ echo "Waiting for server to exit..."
+ sleep 1
+ done
+}
Added: CalendarServer/trunk/contrib/performance/profile.sh
===================================================================
--- CalendarServer/trunk/contrib/performance/profile.sh (rev 0)
+++ CalendarServer/trunk/contrib/performance/profile.sh 2010-11-10 00:18:07 UTC (rev 6582)
@@ -0,0 +1,28 @@
+#!/bin/bash -x
+
+. ./benchlib.sh
+
+set -e # Break on error
+
+sudo -v # Force up to date sudo token before the user walks away
+
+REV=$1
+LOGS=$2
+RESULTS=$3
+
+update_and_build $REV
+
+DATE="`./svn-committime $SOURCE $REV`"
+for backend in $BACKENDS; do
+ setbackend $backend
+ for benchmark in $BENCHMARKS; do
+ pushd $SOURCE
+ mkdir -p profiling/$benchmark
+ start 0 -t Single -S profiling/$benchmark
+ popd
+ sudo ./run.sh ./benchmark --label r$REV-$backend $benchmark
+ pushd $SOURCE
+ stop
+ popd
+ done
+done
Property changes on: CalendarServer/trunk/contrib/performance/profile.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: CalendarServer/trunk/contrib/performance/sample.sh
===================================================================
--- CalendarServer/trunk/contrib/performance/sample.sh 2010-11-09 21:14:22 UTC (rev 6581)
+++ CalendarServer/trunk/contrib/performance/sample.sh 2010-11-10 00:18:07 UTC (rev 6582)
@@ -1,58 +1,27 @@
#!/bin/bash -x
-set -e # Break on error
-shopt -s nullglob # Expand foo* to nothing if nothing matches
+. ./benchlib.sh
sudo -v # Force up to date sudo token before the user walks away
-BACKENDS="filesystem postgresql"
-
-SOURCE=~/Projects/CalendarServer/trunk
-NUM_INSTANCES=2
-BENCHMARKS="event_move event_delete_attendee event_add_attendee event_change_date event_change_summary event_delete vfreebusy event"
-STATISTICS=(HTTP SQL read write pagein pageout)
-ADDURL=http://localhost:8000/result/add/
-export PYTHONPATH=$PYTHONPATH:$SOURCE/../Twisted
-
REV=$1
LOGS=$2
RESULTS=$3
-function stop() {
- ./run -k || true
- while [ -e ./data/Logs/caldavd.pid ]; do
- echo "Waiting for server to exit..."
- sleep 1
- done
-}
+update_and_build $REV
-pushd $SOURCE
-stop
-svn st --no-ignore | grep '^[?I]' | cut -c9- | xargs rm -r
-svn up -r$REV .
-python setup.py build_ext -i
-popd
-
DATE="`./svn-committime $SOURCE $REV`"
for backend in $BACKENDS; do
- ./setbackend $SOURCE/conf/caldavd-test.plist $backend > $SOURCE/conf/caldavd-dev.plist
+ setbackend $backend
pushd $SOURCE
stop
rm -rf data/
- ./run -d -n
- while :; do
- instances=($SOURCE/data/Logs/*instance*)
- if [ "${#instances[*]}" -ne "$NUM_INSTANCES" ]; then
- sleep 2
- else
- break
- fi
- done
+ start 2
echo "instance pid files: ${instances[*]}"
popd
- sudo PYTHONPATH=$PYTHONPATH ./benchmark --label r$REV-$backend --log-directory $LOGS $BENCHMARKS
+ sudo ./run.sh ./benchmark --label r$REV-$backend --log-directory $LOGS $BENCHMARKS
data=`echo -n r$REV-$backend*`
- ./massupload \
+ ./run.sh ./massupload \
--url $ADDURL --revision $REV \
--revision-date "$DATE" --environment nmosbuilder \
--backend $backend \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101109/7cd64743/attachment.html>
More information about the calendarserver-changes
mailing list