[CalendarServer-changes] [6316] CalendarServer/trunk/contrib/performance
source_changes at macosforge.org
source_changes at macosforge.org
Mon Sep 20 10:01:28 PDT 2010
Revision: 6316
http://trac.macosforge.org/projects/calendarserver/changeset/6316
Author: exarkun at twistedmatrix.com
Date: 2010-09-20 10:01:27 -0700 (Mon, 20 Sep 2010)
Log Message:
-----------
Add vfs-level read/write tracing
Also point out some reference material for T stats and remove a debug print from
the sample function.
Modified Paths:
--------------
CalendarServer/trunk/contrib/performance/benchlib.py
CalendarServer/trunk/contrib/performance/benchmark.py
CalendarServer/trunk/contrib/performance/io_measure.d
CalendarServer/trunk/contrib/performance/stats.py
Modified: CalendarServer/trunk/contrib/performance/benchlib.py
===================================================================
--- CalendarServer/trunk/contrib/performance/benchlib.py 2010-09-20 16:00:37 UTC (rev 6315)
+++ CalendarServer/trunk/contrib/performance/benchlib.py 2010-09-20 17:01:27 UTC (rev 6316)
@@ -71,7 +71,6 @@
before = time()
d = agent.request(*paramgen())
def cbResponse(response):
- print response.code
d = readBody(response)
def cbBody(ignored):
after = time()
Modified: CalendarServer/trunk/contrib/performance/benchmark.py
===================================================================
--- CalendarServer/trunk/contrib/performance/benchmark.py 2010-09-20 16:00:37 UTC (rev 6315)
+++ CalendarServer/trunk/contrib/performance/benchmark.py 2010-09-20 17:01:27 UTC (rev 6316)
@@ -120,6 +120,8 @@
when = int(when)
if which == 'ENTRY':
+ if self.start is not None:
+ print 'entry without return at', when, 'in', cmd
self.start = when
elif which == 'RETURN':
if self.start is None:
@@ -142,14 +144,21 @@
_op_ITERNEXT = _op_EXECUTE
def _op_B_READ(self, cmd, rest):
+ self.collector._bread.append(int(rest))
+
+
+ def _op_B_WRITE(self, cmd, rest):
+ self.collector._bwrite.append(int(rest))
+
+
+ def _op_READ(self, cmd, rest):
self.collector._read.append(int(rest))
- def _op_B_WRITE(self, cmd, rest):
+ def _op_WRITE(self, cmd, rest):
self.collector._write.append(int(rest))
-
class DTraceCollector(object):
def __init__(self, script, pids):
self._dScript = script
@@ -158,6 +167,8 @@
def _init_stats(self):
+ self._bread = []
+ self._bwrite = []
self._read = []
self._write = []
self._execute = []
@@ -166,6 +177,8 @@
def stats(self):
results = {
+ Bytes('pagein'): self._bread,
+ Bytes('pageout'): self._bwrite,
Bytes('read'): self._read,
Bytes('write'): self._write,
SQLDuration('execute'): self._execute, # Time spent in the execute phase of SQL execution
Modified: CalendarServer/trunk/contrib/performance/io_measure.d
===================================================================
--- CalendarServer/trunk/contrib/performance/io_measure.d 2010-09-20 16:00:37 UTC (rev 6315)
+++ CalendarServer/trunk/contrib/performance/io_measure.d 2010-09-20 17:01:27 UTC (rev 6316)
@@ -23,6 +23,26 @@
printf("B_WRITE %d\n\1", args[0]->b_bcount);
}
+#define READ(fname) \
+pid$target::fname:return \
+{ \
+ printf("READ %d\n\1", arg1); \
+}
+
+READ(read)
+READ(pread)
+READ(readv)
+
+#define WRITE(fname) \
+pid$target::fname:return \
+{ \
+ printf("WRITE %d\n\1", arg1); \
+}
+
+WRITE(write)
+WRITE(pwrite)
+WRITE(writev)
+
syscall::execve:entry
/copyinstr(arg0) == "CalendarServer dtrace benchmarking signal"/
{
Modified: CalendarServer/trunk/contrib/performance/stats.py
===================================================================
--- CalendarServer/trunk/contrib/performance/stats.py 2010-09-20 16:00:37 UTC (rev 6315)
+++ CalendarServer/trunk/contrib/performance/stats.py 2010-09-20 17:01:27 UTC (rev 6316)
@@ -161,3 +161,7 @@
class Bytes(_Statistic):
def squash(self, samples):
return [sum(bytes) for bytes in samples]
+
+
+ def summarize(self, samples):
+ return _Statistic.summarize(self, self.squash(samples))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100920/268d6cc7/attachment-0001.html>
More information about the calendarserver-changes
mailing list