[CalendarServer-changes] [6929] CalendarServer/trunk/contrib/performance/setbackend.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 15 09:18:43 PST 2011


Revision: 6929
          http://trac.macosforge.org/projects/calendarserver/changeset/6929
Author:   exarkun at twistedmatrix.com
Date:     2011-02-15 09:18:41 -0800 (Tue, 15 Feb 2011)
Log Message:
-----------
Rewrite the config to disable the response cache, too.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/setbackend.py

Modified: CalendarServer/trunk/contrib/performance/setbackend.py
===================================================================
--- CalendarServer/trunk/contrib/performance/setbackend.py	2011-02-15 15:56:07 UTC (rev 6928)
+++ CalendarServer/trunk/contrib/performance/setbackend.py	2011-02-15 17:18:41 UTC (rev 6929)
@@ -14,6 +14,12 @@
 # limitations under the License.
 ##
 
+"""
+Generate a new calendar server configuration file based on an existing
+one, with a few values changed to satisfy requirements of the
+benchmarking tools.
+"""
+
 import sys
 from xml.etree import ElementTree
 from xml.etree import ElementPath
@@ -26,16 +32,20 @@
         value = 'false'
     else:
         raise RuntimeError("Don't know what to do with %r" % (sys.argv[2],))
-    replace(conf.getiterator(), value)
+
+    # Here are the config changes we make - use the specified backend
+    replace(conf.getiterator(), 'UseDatabase', value)
+    # - and disable the response cache
+    replace(conf.getiterator(), 'EnableResponseCache', 'false')
     conf.write(sys.stdout)
 
 
-def replace(elements, value):
+def replace(elements, key, value):
     found = False
     for ele in elements:
         if found:
             ele.tag = value
             return
-        if ele.tag == 'key' and ele.text == 'UseDatabase':
+        if ele.tag == 'key' and ele.text == key:
             found = True
     raise RuntimeError("Failed to find <key>UseDatabase</key>")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110215/9be27d12/attachment-0001.html>


More information about the calendarserver-changes mailing list