[CalendarServer-changes] [6645] CalendarServer/trunk/contrib/performance/event.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 17 08:21:06 PST 2010


Revision: 6645
          http://trac.macosforge.org/projects/calendarserver/changeset/6645
Author:   cdaboo at apple.com
Date:     2010-11-17 08:21:03 -0800 (Wed, 17 Nov 2010)
Log Message:
-----------
Make sure the organizer actually matches the owner of the calendar home in which events are created. Also, add an ATTENDEE
property matching the organizer for more realism. SEQUENCE does not need to change with iterations.

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

Modified: CalendarServer/trunk/contrib/performance/event.py
===================================================================
--- CalendarServer/trunk/contrib/performance/event.py	2010-11-17 15:33:33 UTC (rev 6644)
+++ CalendarServer/trunk/contrib/performance/event.py	2010-11-17 16:21:03 UTC (rev 6645)
@@ -46,12 +46,20 @@
 
 attendee = """\
 ATTENDEE;CN=User %(SEQUENCE)02d;CUTYPE=INDIVIDUAL;EMAIL=user%(SEQUENCE)02d at example.com;PARTSTAT=NE
- EDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:uuid:use
- r%(SEQUENCE)02d
+ EDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE;:urn:uuid:user%(SEQUENCE)02d
 """
 
+organizer = """\
+ORGANIZER;CN=User %(SEQUENCE)02d;EMAIL=user%(SEQUENCE)02d at example.com:urn:uuid:user%(SEQUENCE)02d
+ATTENDEE;CN=User %(SEQUENCE)02d;EMAIL=user%(SEQUENCE)02d at example.com;PARTSTAT=ACCEPTE
+ D:urn:uuid:user%(SEQUENCE)02d
+"""
+
+def makeOrganizer(sequence):
+    return organizer % {'SEQUENCE': sequence}
+
 def makeAttendees(count):
-    return '\n'.join([
+    return ''.join([
             attendee % {'SEQUENCE': n} for n in range(2, count + 2)])
 
 
@@ -61,17 +69,17 @@
 
 SUMMARY = "STUFF IS THINGS"
 
-def makeEvent(i, attendeeCount):
+def makeEvent(i, organizerSequence, attendeeCount):
     s = """\
 BEGIN:VEVENT
 UID:%(UID)s
 DTSTART;TZID=America/Los_Angeles:%(START)s
 DTEND;TZID=America/Los_Angeles:%(END)s
-%(ATTENDEES)s\
 CREATED:20100729T193912Z
 DTSTAMP:20100729T195557Z
-ORGANIZER;CN=User 03;EMAIL=user03 at example.com:urn:uuid:user03
-SEQUENCE:%(SEQUENCE)s
+%(ORGANIZER)s\
+%(ATTENDEES)s\
+SEQUENCE:0
 SUMMARY:%(summary)s
 TRANSP:OPAQUE
 END:VEVENT
@@ -84,7 +92,7 @@
             'UID': uuid4(),
             'START': formatDate(base + i * interval),
             'END': formatDate(base + i * interval + duration),
-            'SEQUENCE': i,
+            'ORGANIZER': makeOrganizer(organizerSequence),
             'ATTENDEES': makeAttendees(attendeeCount),
             'summary': SUMMARY,
             },
@@ -93,7 +101,8 @@
 
 @inlineCallbacks
 def measure(host, port, dtrace, attendeeCount, samples):
-    user = password = "user01"
+    organizerSequence = 1
+    user = password = "user%02d" % (organizerSequence,)
     root = "/"
     principal = "/"
     calendar = "event-creation-benchmark"
@@ -115,7 +124,7 @@
     headers = Headers({"content-type": ["text/calendar"]})
 
     # An infinite stream of VEVENTs to PUT to the server.
-    events = ((i, makeEvent(i, attendeeCount)) for i in count(2))
+    events = ((i, makeEvent(i, organizerSequence, attendeeCount)) for i in count(2))
 
     # Sample it a bunch of times
     samples = yield sample(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101117/baf8d0cf/attachment.html>


More information about the calendarserver-changes mailing list