[CalendarServer-changes] [1874]
CalendarClientSimulator/trunk/src/calendarclient.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Sep 13 12:51:12 PDT 2007
Revision: 1874
http://trac.macosforge.org/projects/calendarserver/changeset/1874
Author: cdaboo at apple.com
Date: 2007-09-13 12:51:12 -0700 (Thu, 13 Sep 2007)
Log Message:
-----------
We want events and invites to occur at random times reletive to the start of the simulation. Also bump sleep down to 1
second as we need to do higher frequency polls to simulate an effecyive number of users.
Modified Paths:
--------------
CalendarClientSimulator/trunk/src/calendarclient.py
Modified: CalendarClientSimulator/trunk/src/calendarclient.py
===================================================================
--- CalendarClientSimulator/trunk/src/calendarclient.py 2007-09-13 19:16:23 UTC (rev 1873)
+++ CalendarClientSimulator/trunk/src/calendarclient.py 2007-09-13 19:51:12 UTC (rev 1874)
@@ -93,8 +93,8 @@
@param pszCNonce: The cnonce
@param preHA1: If available this is a str containing a previously
- calculated HA1 as a hex string. If this is given then the values for
- pszUserName, pszRealm, and pszPassword are ignored.
+ calculated HA1 as a hex string. If this is given then the values for
+ pszUserName, pszRealm, and pszPassword are ignored.
"""
if (preHA1 and (pszUserName or pszRealm or pszPassword)):
@@ -172,7 +172,7 @@
outboxURI = "/calendars/users/%s/outbox/"
inboxURI = "/calendars/users/%s/inbox/"
- sleep = 5
+ sleep = 1
def __init__(self):
self.server = None
@@ -235,11 +235,14 @@
def simulate(self):
self.log("Starting CalendarClient simulation for user %s" % (self.user,))
- start_poll = time.time() - self.interval - 1
- start_events = time.time()
- start_invites = time.time()
+ self.doPoll()
+
+ # Do polling loop using a randomly distributed start time for polling and events/invites
+ start_poll = time.time() - randint(0, self.interval - 1)
event_interval = 24 * 60 * 60 / self.eventsperday
invite_interval = 24 * 60 * 60 / self.invitesperday
+ start_events = time.time() - randint(0, event_interval - 1)
+ start_invites = time.time() - randint(0, invite_interval - 1)
while(True):
if time.time() >= start_poll + self.interval:
start_poll = time.time()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070913/f93a3db8/attachment.html
More information about the calendarserver-changes
mailing list