[CalendarServer-changes] [15651] CalendarServer/trunk/contrib/performance/loadtest
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jun 3 09:55:17 PDT 2016
Revision: 15651
http://trac.calendarserver.org//changeset/15651
Author: cdaboo at apple.com
Date: 2016-06-03 09:55:17 -0700 (Fri, 03 Jun 2016)
Log Message:
-----------
Add % column to results tables.
Modified Paths:
--------------
CalendarServer/trunk/contrib/performance/loadtest/logger.py
CalendarServer/trunk/contrib/performance/loadtest/population.py
CalendarServer/trunk/contrib/performance/loadtest/profiles.py
Modified: CalendarServer/trunk/contrib/performance/loadtest/logger.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/logger.py 2016-06-03 15:58:42 UTC (rev 15650)
+++ CalendarServer/trunk/contrib/performance/loadtest/logger.py 2016-06-03 16:55:17 UTC (rev 15651)
@@ -38,7 +38,7 @@
output.write("%s\n" % ("-" * len(header),))
- def _summarizeData(self, operation, data):
+ def _summarizeData(self, operation, data, total_count):
failed = 0
thresholds = [0] * len(self._thresholds)
durations = []
@@ -64,7 +64,7 @@
if thresholds[ctr] * 100.0 / count > fail_at:
failure = True
- return (operation, count, failed,) + \
+ return (operation, count, ((100.0 * count) / total_count) if total_count else 0.0, failed,) + \
tuple(thresholds) + \
(mean(durations), median(durations), stddev(durations), "FAIL" if failure else "")
@@ -85,5 +85,6 @@
Each element is a two-tuple of whether the operation succeeded
(C{True} if so, C{False} if not) and how long the operation took.
"""
+ total_count = sum(map(lambda x: len(x[1]), perOperationTimes))
for method, data in perOperationTimes:
- self._printRow(output, formats, self._summarizeData(method, data))
+ self._printRow(output, formats, self._summarizeData(method, data, total_count))
Modified: CalendarServer/trunk/contrib/performance/loadtest/population.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/population.py 2016-06-03 15:58:42 UTC (rev 15650)
+++ CalendarServer/trunk/contrib/performance/loadtest/population.py 2016-06-03 16:55:17 UTC (rev 15651)
@@ -412,6 +412,7 @@
_fields_init = [
('request', -30, '%-30s'),
('count', 8, '%8s'),
+ ('%', 6, '%6.1f'),
('failed', 8, '%8s'),
]
@@ -542,8 +543,8 @@
return ((value / test_mean) - 1.0) * weight + 1.0
- def _summarizeData(self, operation, data):
- data = SummarizingMixin._summarizeData(self, operation, data)
+ def _summarizeData(self, operation, data, total_count):
+ data = SummarizingMixin._summarizeData(self, operation, data, total_count)
value = self.qos_value(operation, data[-4])
if value is None:
value = 0.0
Modified: CalendarServer/trunk/contrib/performance/loadtest/profiles.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/profiles.py 2016-06-03 15:58:42 UTC (rev 15650)
+++ CalendarServer/trunk/contrib/performance/loadtest/profiles.py 2016-06-03 16:55:17 UTC (rev 15651)
@@ -584,6 +584,7 @@
0, self._client.getAttachment, attachmentHref, managedId
)
+
def _normalizeHref(self, href):
return urljoin(self._client._managed_attachments_server_url, urlparse(href).path)
@@ -721,7 +722,6 @@
return Deferred()
-
def modifyEvent(self, href, vevent):
"""Overridden by subclasses"""
pass
@@ -1096,6 +1096,7 @@
return self._newOperation("create", d)
+
class TimeRanger(ProfileBase):
"""
A profile which does time queries
@@ -1232,6 +1233,7 @@
_fields_init = [
('operation', -30, '%-30s'),
('count', 8, '%8s'),
+ ('%', 6, '%6.1f'),
('failed', 8, '%8s'),
]
@@ -1297,9 +1299,9 @@
dataset.append(lag)
- def _summarizeData(self, operation, data):
+ def _summarizeData(self, operation, data, total_count):
avglag = mean(self._perOperationLags.get(operation, [0.0])) * 1000.0
- data = SummarizingMixin._summarizeData(self, operation, data)
+ data = SummarizingMixin._summarizeData(self, operation, data, total_count)
return data[:-1] + (avglag,) + data[-1:]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160603/2b928ccb/attachment-0001.html>
More information about the calendarserver-changes
mailing list