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

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 18 19:26:05 PDT 2011


Revision: 7804
          http://trac.macosforge.org/projects/calendarserver/changeset/7804
Author:   cdaboo at apple.com
Date:     2011-07-18 19:26:05 -0700 (Mon, 18 Jul 2011)
Log Message:
-----------
Fix some exception handling and logging details.

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

Modified: CalendarServer/trunk/contrib/performance/loadtest/ical.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/ical.py	2011-07-18 17:00:38 UTC (rev 7803)
+++ CalendarServer/trunk/contrib/performance/loadtest/ical.py	2011-07-19 02:26:05 UTC (rev 7804)
@@ -157,7 +157,7 @@
         if item:
             node = item.getAttribute("node")
             if node:
-                url, name, kind = self.nodes.get(node, (None, None, None))
+                url, _ignore_name, _ignore_kind = self.nodes.get(node, (None, None, None))
                 if url is not None:
                     self._client._checkCalendarsForEvents(url)
 
@@ -565,6 +565,8 @@
         msg(type="operation", phase="start", user=self.record.uid, label=label)
         def finished(passthrough):
             success = not isinstance(passthrough, Failure)
+            if not success:
+                passthrough.trap(IncorrectResponseCode)
             after = self.reactor.seconds()
             msg(type="operation", phase="end", duration=after - before,
                 user=self.record.uid, label=label, success=success)
@@ -580,7 +582,7 @@
         host, port = params.server.split(':')
         port = int(port)
 
-        service, stuff = params.uri.split('?')
+        service, _ignore_stuff = params.uri.split('?')
         service = service.split(':', 1)[1]
 
         # XXX What is the domain of the 2nd argument supposed to be?  The

Modified: CalendarServer/trunk/contrib/performance/loadtest/profiles.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/profiles.py	2011-07-18 17:00:38 UTC (rev 7803)
+++ CalendarServer/trunk/contrib/performance/loadtest/profiles.py	2011-07-19 02:26:05 UTC (rev 7804)
@@ -96,6 +96,9 @@
 
         def finished(passthrough):
             success = not isinstance(passthrough, Failure)
+            if not success:
+                passthrough.trap(IncorrectResponseCode)
+                passthrough = passthrough.response
             after = self._reactor.seconds()
             msg(type="operation", phase="end", duration=after - before,
                 user=self._client.record.uid, label=label, success=success)
@@ -153,7 +156,7 @@
         for att in attendees:
             invitees.add(att.value)
 
-        for i in range(10):
+        for _ignore_i in range(10):
             invitee = max(
                 0, self._number + self._inviteeDistanceDistribution.sample())
             try:
@@ -314,7 +317,7 @@
         def scheduleError(reason):
             reason.trap(IncorrectResponseCode)
             if reason.value.response.code != PRECONDITION_FAILED:
-                return reason
+                return reason.value.response.code
 
             # Download the event again and attempt to make the change
             # to the attendee list again.
@@ -347,9 +350,12 @@
         d = self._client.deleteEvent(href)
         def finished(passthrough):
             self._accepting.remove(href)
+            if isinstance(passthrough, Failure):
+                passthrough.trap(IncorrectResponseCode)
+                passthrough = passthrough.response
             return passthrough
         d.addBoth(finished)
-        return self._newOperation("clean reply", d)
+        return self._newOperation("reply done", d)
 
 
     def _handleCancel(self, href):
@@ -367,9 +373,12 @@
         d.addCallback(removed)
         def finished(passthrough):
             self._accepting.remove(href)
+            if isinstance(passthrough, Failure):
+                passthrough.trap(IncorrectResponseCode)
+                passthrough = passthrough.response
             return passthrough
         d.addBoth(finished)
-        return self._newOperation("clean cancel", d)
+        return self._newOperation("cancelled", d)
 
 
     def _makeAcceptedAttendee(self, attendee):
@@ -524,7 +533,7 @@
         print
         self.printHeader([
                 (label, width)
-                for (label, width, fmt)
+                for (label, width, _ignore_fmt)
                 in self._fields])
         self.printData(
             [fmt for (label, width, fmt) in self._fields],
@@ -548,7 +557,7 @@
                         operation=operation.upper(), cutoff=lagCutoff * 1000))
 
         for operation, times in self._perOperationTimes.iteritems():
-            failures = len([success for (success, duration) in times if not success])
+            failures = len([success for (success, _ignore_duration) in times if not success])
             if failures / len(times) > failCutoff:
                 reasons.append(self._FAILED_REASON % dict(
                         operation=operation.upper(), cutoff=failCutoff * 100))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110718/b2a5f549/attachment.html>


More information about the calendarserver-changes mailing list