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

source_changes at macosforge.org source_changes at macosforge.org
Thu May 12 14:35:45 PDT 2016


Revision: 15589
          http://trac.calendarserver.org//changeset/15589
Author:   sagen at apple.com
Date:     2016-05-12 14:35:45 -0700 (Thu, 12 May 2016)
Log Message:
-----------
Adds a sim config for what percentage of new events and invites will get attachments.

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	2016-05-12 19:28:46 UTC (rev 15588)
+++ CalendarServer/trunk/contrib/performance/loadtest/clients.plist	2016-05-12 21:35:45 UTC (rev 15589)
@@ -164,6 +164,10 @@
 								</dict>
 							</dict>
 
+							<!-- Percentage of time to attach a file -->
+							<key>fileAttachPercentage</key>
+							<integer>5</integer>
+
 							<!-- Define the attachment size distribution. -->
 							<key>fileSizeDistribution</key>
 							<dict>
@@ -597,6 +601,10 @@
 								</dict>
 							</dict>
 
+							<!-- Percentage of time to attach a file -->
+							<key>fileAttachPercentage</key>
+							<integer>10</integer>
+
 							<!-- Define the attachment size distribution. -->
 							<key>fileSizeDistribution</key>
 							<dict>

Modified: CalendarServer/trunk/contrib/performance/loadtest/profiles.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/profiles.py	2016-05-12 19:28:46 UTC (rev 15588)
+++ CalendarServer/trunk/contrib/performance/loadtest/profiles.py	2016-05-12 21:35:45 UTC (rev 15589)
@@ -261,6 +261,7 @@
             120 * 60
         ]),
         recurrenceDistribution=RecurrenceDistribution(False),
+        fileAttachPercentage=30,
         fileSizeDistribution=NormalDistribution(1024, 1),
     ):
         self.enabled = enabled
@@ -271,6 +272,7 @@
         self._eventStartDistribution = eventStartDistribution
         self._eventDurationDistribution = eventDurationDistribution
         self._recurrenceDistribution = recurrenceDistribution
+        self._fileAttachPercentage = fileAttachPercentage
         self._fileSizeDistribution = fileSizeDistribution
 
 
@@ -371,7 +373,12 @@
                 except CannotAddAttendee:
                     continue
 
-            attachmentSize = int(self._fileSizeDistribution.sample())
+            choice = self.random.randint(1, 100)
+            if choice <= self._fileAttachPercentage:
+                attachmentSize = int(self._fileSizeDistribution.sample())
+            else:
+                attachmentSize = 0 # no attachment
+
             href = '%s%s.ics' % (calendar.url, uid)
             d = self._client.addInvite(href, vcalendar, attachmentSize=attachmentSize)
             return self._newOperation("invite", d)
@@ -609,6 +616,7 @@
             120 * 60
         ]),
         recurrenceDistribution=RecurrenceDistribution(False),
+        fileAttachPercentage=30,
         fileSizeDistribution=NormalDistribution(1024, 1),
     ):
         self.enabled = enabled
@@ -616,6 +624,7 @@
         self._eventStartDistribution = eventStartDistribution
         self._eventDurationDistribution = eventDurationDistribution
         self._recurrenceDistribution = recurrenceDistribution
+        self._fileAttachPercentage = fileAttachPercentage
         self._fileSizeDistribution = fileSizeDistribution
 
 
@@ -653,7 +662,12 @@
         if rrule is not None:
             vevent.addProperty(Property(None, None, None, pycalendar=rrule))
 
-        attachmentSize = int(self._fileSizeDistribution.sample())
+        choice = self.random.randint(1, 100)
+        if choice <= self._fileAttachPercentage:
+            attachmentSize = int(self._fileSizeDistribution.sample())
+        else:
+            attachmentSize = 0 # no attachment
+
         href = '%s%s.ics' % (calendar.url, uid)
         d = self._client.addEvent(href, vcalendar, attachmentSize=attachmentSize)
         return self._newOperation("create", d)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160512/df99e423/attachment.html>


More information about the calendarserver-changes mailing list