[CalendarServer-changes] [15329] CalendarServer/trunk/contrib/performance/loadtest

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 18 10:41:32 PST 2015


Revision: 15329
          http://trac.calendarserver.org//changeset/15329
Author:   sagen at apple.com
Date:     2015-11-18 10:41:32 -0800 (Wed, 18 Nov 2015)
Log Message:
-----------
Adds a DescriptionChanger profile to sim

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/loadtest/clients.plist
    CalendarServer/trunk/contrib/performance/loadtest/profiles.py

Modified: CalendarServer/trunk/contrib/performance/loadtest/clients.plist
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/clients.plist	2015-11-18 00:56:59 UTC (rev 15328)
+++ CalendarServer/trunk/contrib/performance/loadtest/clients.plist	2015-11-18 18:41:32 UTC (rev 15329)
@@ -304,6 +304,41 @@
 						</dict>
 					</dict>
 
+					<!-- Picks a random event and changes the description -->
+					<dict>
+						<key>class</key>
+						<string>contrib.performance.loadtest.profiles.DescriptionChanger</string>
+
+						<key>params</key>
+						<dict>
+							<key>enabled</key>
+							<true/>
+
+							<!-- Define the interval (in seconds) at which this profile will use
+								its client to create a new event. -->
+							<key>interval</key>
+							<integer>120</integer>
+
+							<!-- Define the description length distribution. -->
+							<key>descriptionLengthDistribution</key>
+							<dict>
+								<key>type</key>
+								<string>contrib.performance.stats.NormalDistribution</string>
+								<key>params</key>
+								<dict>
+									<!-- mu gives the mean of the normal distribution (in seconds). -->
+									<key>mu</key>
+									<integer>5000</integer>
+
+									<!-- and sigma gives its standard deviation. -->
+									<key>sigma</key>
+									<integer>100</integer>
+								</dict>
+							</dict>
+
+						</dict>
+					</dict>
+
 					<!-- Picks a random event and attaches -->
 					<dict>
 						<key>class</key>

Modified: CalendarServer/trunk/contrib/performance/loadtest/profiles.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/profiles.py	2015-11-18 00:56:59 UTC (rev 15328)
+++ CalendarServer/trunk/contrib/performance/loadtest/profiles.py	2015-11-18 18:41:32 UTC (rev 15329)
@@ -657,7 +657,25 @@
         return succeed("update{title}")
 
 
+class DescriptionChanger(EventUpdaterBase):
 
+    def setParameters(
+        self,
+        enabled=True,
+        interval=60,
+        descriptionLengthDistribution=NormalDistribution(10, 2)
+    ):
+        self.enabled = enabled
+        self._interval = interval
+        self._descriptionLength = descriptionLengthDistribution
+
+
+    def modifyEvent(self, _ignore_href, vevent):
+        length = int(self._descriptionLength.sample())
+        vevent.replaceProperty(Property("DESCRIPTION", "." * length))
+        return succeed("update{description}")
+
+
 class Attacher(EventUpdaterBase):
 
     def setParameters(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151118/976bea60/attachment.html>


More information about the calendarserver-changes mailing list