[Checkins] SVN: z3c.profiler/trunk/ - Fixed processing profile data for display in web UI, so the data is
Michael Howitz
mh at gocept.com
Sat Dec 26 06:03:27 EST 2009
Log message for revision 107076:
- Fixed processing profile data for display in web UI, so the data is
now displayed on the web page. Kept the previous behavior to print
unprocessed profile data on `stdout`.
- Removed unused dependency on ``z3c.i18n``.
- Removed not necessary and undeclared test depenency on
``zope.app.authentication``.
- Removed zpkg and ZCML install slugs.
Changed:
U z3c.profiler/trunk/CHANGES.txt
U z3c.profiler/trunk/setup.py
D z3c.profiler/trunk/src/z3c/profiler/SETUP.cfg
U z3c.profiler/trunk/src/z3c/profiler/browser/profiler.py
U z3c.profiler/trunk/src/z3c/profiler/setup.zcml
U z3c.profiler/trunk/src/z3c/profiler/wsgi.py
D z3c.profiler/trunk/src/z3c/profiler/z3c.profiler-configure.zcml
-=-
Modified: z3c.profiler/trunk/CHANGES.txt
===================================================================
--- z3c.profiler/trunk/CHANGES.txt 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/CHANGES.txt 2009-12-26 11:03:26 UTC (rev 107076)
@@ -1,13 +1,22 @@
=======
-CHANGES
+Changes
=======
0.8.1 (unreleased)
------------------
-- Nothing changed yet.
+- Fixed processing profile data for display in web UI, so the data is
+ now displayed on the web page. Kept the previous behavior to print
+ unprocessed profile data on `stdout`.
+- Removed unused dependency on ``z3c.i18n``.
+- Removed not necessary and undeclared test depenency on
+ ``zope.app.authentication``.
+
+- Removed zpkg and ZCML install slugs.
+
+
0.8.0 (2009-06-19)
------------------
Modified: z3c.profiler/trunk/setup.py
===================================================================
--- z3c.profiler/trunk/setup.py 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/setup.py 2009-12-26 11:03:26 UTC (rev 107076)
@@ -81,7 +81,6 @@
'zope.testing',
'zope.traversing',
'zope.viewlet',
- 'z3c.i18n',
'z3c.macro',
'z3c.pagelet',
'z3c.template',
Deleted: z3c.profiler/trunk/src/z3c/profiler/SETUP.cfg
===================================================================
--- z3c.profiler/trunk/src/z3c/profiler/SETUP.cfg 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/src/z3c/profiler/SETUP.cfg 2009-12-26 11:03:26 UTC (rev 107076)
@@ -1,3 +0,0 @@
-<data-files zopeskel/etc/package-includes>
- z3c.profiler-*.zcml
-</data-files>
Modified: z3c.profiler/trunk/src/z3c/profiler/browser/profiler.py
===================================================================
--- z3c.profiler/trunk/src/z3c/profiler/browser/profiler.py 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/src/z3c/profiler/browser/profiler.py 2009-12-26 11:03:26 UTC (rev 107076)
@@ -30,16 +30,16 @@
class ProfilerPagelet(browser.BrowserPagelet):
"""Profiler page.
-
- It whould be so easy with z3c.form, but I decided to depend on
+
+ It whould be so easy with z3c.form, but I decided to depend on
less packages as possible and not using z3c.form and other packages.
Forgive me the z3c.pagelet usage but it's so nice to do layout things
without METAL macros ;-)
Note: I didn't internationalize the profiler, should we?
- The stats output is horrible for formatting in html, but let's try to
- support a nice table instead of the ugly print out whihc needs a
+ The stats output is horrible for formatting in html, but let's try to
+ support a nice table instead of the ugly print out whihc needs a
monitor with at least 3000px width.
"""
@@ -116,13 +116,13 @@
mode = self.request.get('mode', 'stats')
limit = int(self.request.get('limit', 500))
- stdout = sys.stdout
- sys.stdout = output
+ stats_stream = stats.stream
+ stats.stream = output
try:
getattr(stats, 'print_%s'%mode)(limit)
finally:
- sys.stdout = stdout
+ stats.stream = stats_stream
output.seek(0)
data = output
@@ -137,6 +137,7 @@
if mode == 'stats':
for i, line in enumerate(lines):
+ print line,
try:
ncalls, tottime, totpercall, cumtime, percall, fn = line.split()
d = {}
@@ -166,7 +167,9 @@
for i, line in enumerate(lines):
try:
d = {}
- if '...' in line:
+ print line,
+ if ('...' in line or
+ 'Ordered by:' in line):
# skip header line
continue
varius = line.split()
@@ -177,14 +180,23 @@
d['caller'] = varius[0]
d['time'] = ''
elif len(varius) == 2:
- d['fn'] = ''
- d['caller'] = varius[0]
- d['time'] = varius[1]
+ if varius[1] in ['->', '<-']:
+ d['fn'] = varius[0]
+ d['caller'] = ''
+ d['time'] = ''
+ else:
+ d['fn'] = ''
+ d['caller'] = varius[0]
+ d['time'] = varius[1]
elif len(varius) == 3:
d['fn'] = varius[0]
d['caller'] = varius[1]
d['time'] = varius[2]
- if len(varius) >3:
+ elif len(varius) == 4:
+ d['fn'] = varius[0]
+ d['caller'] = varius[2]
+ d['time'] = varius[3]
+ elif len(varius) > 4:
continue
append(d)
except ValueError, e:
Modified: z3c.profiler/trunk/src/z3c/profiler/setup.zcml
===================================================================
--- z3c.profiler/trunk/src/z3c/profiler/setup.zcml 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/src/z3c/profiler/setup.zcml 2009-12-26 11:03:26 UTC (rev 107076)
@@ -9,15 +9,6 @@
<meta:provides feature="devmode" />
<!-- exclude will prevent from include -->
- <exclude package="zope.app.authentication" file="ftpplugins.zcml" />
- <exclude package="zope.app.authentication" file="groupfolder.zcml" />
- <exclude package="zope.app.authentication" file="principalfolder.zcml" />
- <exclude package="zope.app.authentication.browser" />
- <exclude package="zope.app.authentication.browser" file="configure.zcml" />
- <exclude package="zope.app.authentication.browser" file="groupfolder.zcml" />
- <exclude package="zope.app.authentication.browser" file="httpplugins.zcml" />
- <exclude package="zope.app.authentication.browser" file="principalfolder.zcml" />
- <exclude package="zope.app.authentication.browser" file="session.zcml" />
<exclude package="zope.dublincore.browser" />
<exclude package="zope.app.generations.browser" />
@@ -49,6 +40,7 @@
<include package="zope.app.server" />
<!-- zope packages -->
+ <include package="zope.password" />
<include package="zope.annotation" />
<include package="zope.component" />
<include package="zope.container" />
@@ -69,7 +61,6 @@
<include package="zope.session" />
<!-- zope app package configuration -->
- <include package="zope.app.authentication" />
<include package="zope.app.generations" file="subscriber.zcml" />
<include package="zope.app.publication" />
<include package="zope.app.publisher" />
Modified: z3c.profiler/trunk/src/z3c/profiler/wsgi.py
===================================================================
--- z3c.profiler/trunk/src/z3c/profiler/wsgi.py 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/src/z3c/profiler/wsgi.py 2009-12-26 11:03:26 UTC (rev 107076)
@@ -34,7 +34,7 @@
prof = profile.Profile(time.time)
response = prof.runcall(orig_call, self, environ, start_response)
-
+
lock= _lock
lock.acquire()
@@ -42,7 +42,7 @@
global _stats
uri = environ.get('REQUEST_URI', '')
-
+
if _stats.has_key(uri):
_stats[uri][0].add(prof)
_stats[uri][2] = _stats[uri][2] + 1
Deleted: z3c.profiler/trunk/src/z3c/profiler/z3c.profiler-configure.zcml
===================================================================
--- z3c.profiler/trunk/src/z3c/profiler/z3c.profiler-configure.zcml 2009-12-26 09:54:53 UTC (rev 107075)
+++ z3c.profiler/trunk/src/z3c/profiler/z3c.profiler-configure.zcml 2009-12-26 11:03:26 UTC (rev 107076)
@@ -1,6 +0,0 @@
-<configure
- xmlns:zcml="http://namespaces.zope.org/zcml">
-
- <include package="z3c.profiler" />
-
-</configure>
More information about the checkins
mailing list