@@ -0,0 +1,2349 @@
+##%0A# Copyright (c) 2011 Apple Inc. All rights reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#     http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A##%0A%0A%22%22%22%0ABenchmark a server's handling of events with an unbounded recurrence.%0A%22%22%22%0A%0Afrom uuid import uuid4%0Afrom itertools import count%0Afrom datetime import datetime, timedelta%0A%0Afrom _event_create import formatDate, measure as _measure%0A%0ADAILY_EVENT = %22%22%22%5C%0ABEGIN:VCALENDAR%0AVERSION:2.0%0APRODID:-//Apple Inc.//iCal 4.0.3//EN%0ACALSCALE:GREGORIAN%0ABEGIN:VTIMEZONE%0ATZID:America/New_York%0ABEGIN:DAYLIGHT%0ATZOFFSETFROM:-0500%0ARRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU%0ADTSTART:20070311T020000%0ATZNAME:EDT%0ATZOFFSETTO:-0400%0AEND:DAYLIGHT%0ABEGIN:STANDARD%0ATZOFFSETFROM:-0400%0ARRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU%0ADTSTART:20071104T020000%0ATZNAME:EST%0ATZOFFSETTO:-0500%0AEND:STANDARD%0AEND:VTIMEZONE%0ABEGIN:VEVENT%0ACREATED:20110223T184640Z%0AUID:%25(UID)s%0ADTEND;TZID=America/New_York:%25(DTEND)s%0ARRULE:FREQ=WEEKLY%0ATRANSP:OPAQUE%0ASUMMARY:A meeting which occurs daily for several days.%0ADTSTART;TZID=America/New_York:%25(DTSTART)s%0ADTSTAMP:20110223T184658Z%0ASEQUENCE:5%0AEND:VEVENT%0AEND:VCALENDAR%0A%22%22%22%0A%0Adef makeEvent(i):%0A    %22%22%22%0A    Create a new half-hour long event that starts soon and recurs%0A    daily for the next five days.%0A    %22%22%22%0A    now = datetime.now()%0A    start = now.replace(minute=15, second=0, microsecond=0) + timedelta(hours=i)%0A    end = start + timedelta(minutes=30)%0A    until = start + timedelta(days=5)%0A    return DAILY_EVENT %25 %7B%0A        'DTSTART': formatDate(start),%0A        'DTEND': formatDate(end),%0A        'UID': uuid4(),%0A        %7D%0A%0A%0Adef measure(host, port, dtrace, attendeeCount, samples):%0A    calendar = %22unbounded-recurrence%22%0A    organizerSequence = 1%0A%0A    # An infinite stream of recurring VEVENTS to PUT to the server.%0A    events = ((i, makeEvent(i)) for i in count(2))%0A%0A    return _measure(%0A        calendar, organizerSequence, events,%0A        host, port, dtrace, samples)%0A%0A

Add a benchmark for event creation with an unbounded recurrence.