[CalendarServer-changes] [6117] CalendarServer/trunk/contrib/performance

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 18 15:07:36 PDT 2010


Revision: 6117
          http://trac.macosforge.org/projects/calendarserver/changeset/6117
Author:   exarkun at twistedmatrix.com
Date:     2010-08-18 15:07:35 -0700 (Wed, 18 Aug 2010)
Log Message:
-----------
most basic possible graphing for some of the collected data

Added Paths:
-----------
    CalendarServer/trunk/contrib/performance/graph
    CalendarServer/trunk/contrib/performance/graph.py

Added: CalendarServer/trunk/contrib/performance/graph
===================================================================
--- CalendarServer/trunk/contrib/performance/graph	                        (rev 0)
+++ CalendarServer/trunk/contrib/performance/graph	2010-08-18 22:07:35 UTC (rev 6117)
@@ -0,0 +1,3 @@
+#!/usr/bin/python
+from graph import main
+main()


Property changes on: CalendarServer/trunk/contrib/performance/graph
___________________________________________________________________
Added: svn:executable
   + *

Added: CalendarServer/trunk/contrib/performance/graph.py
===================================================================
--- CalendarServer/trunk/contrib/performance/graph.py	                        (rev 0)
+++ CalendarServer/trunk/contrib/performance/graph.py	2010-08-18 22:07:35 UTC (rev 6117)
@@ -0,0 +1,31 @@
+
+import sys, pickle
+
+from matplotlib import pyplot
+import numpy
+
+from compare import select
+
+def main():
+    fig = pyplot.figure()
+    ax = fig.add_subplot(111)
+
+    data = []
+    for fname in sys.argv[1:]:
+        stats, samples = select(
+            pickle.load(file(fname)), 'vfreebusy', 1, 'urlopen time')
+        data.append(samples)
+        if data:
+            assert len(samples) == len(data[0])
+
+    bars = []
+    color = iter('rgbcmy').next
+    w = 1.0 / len(data)
+    xs = numpy.arange(len(data[0]))
+    for i, s in enumerate(data):
+        bars.append(ax.bar(xs + i * w, s, width=w, color=color())[0])
+
+    ax.set_xlabel('sample #')
+    ax.set_ylabel('seconds')
+    ax.legend(bars, sys.argv[1:])
+    pyplot.show()    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100818/bcf437ad/attachment-0001.html>


More information about the calendarserver-changes mailing list