Re: [Zope-dev] ZPublisher timing hooks ?
Simon Michael wrote at 2004-10-7 19:10 -0700: > ... >Do you know if there are any facilities for this already in ZPublisher ? >Any tips or pointers welcome. You can look how ZopeProfiler hooks itself into ZPublisher (using MonkeyPathing). You can do something similar for time measurements. -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPublisher timing hooks ?
Hi, Am Fr, den 08.10.2004 schrieb Simon Michael um 4:10: > Hi all, > > I'd like to print a "this page was rendered in ... milliseconds" as you > see on php sites. I think I'd get better accuracy by getting at least > the start time from ZPublisher because.. actually it may not help, but > I'm thinking about the case where a request generates a redirect and > another request. I'd like to time the whole thing. Well, retry requests in case of a storage conflict. But redirects will actually cause two distinct requests you cannot join together. When you want to show the render time, a DateTime() at start and at end should suffice. I dont think you can get much better figures here. Regards Tino > Do you know if there are any facilities for this already in ZPublisher ? > Any tips or pointers welcome. > > -Simon > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://mail.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope ) > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPublisher timing hooks ?
On Thu, Oct 07, 2004 at 07:10:30PM -0700, Simon Michael wrote: > Hi all, > > I'd like to print a "this page was rendered in ... milliseconds" as you > see on php sites. I think I'd get better accuracy by getting at least > the start time from ZPublisher because.. actually it may not help, but > I'm thinking about the case where a request generates a redirect and > another request. I'd like to time the whole thing. > > Do you know if there are any facilities for this already in ZPublisher ? > Any tips or pointers welcome. I dunno about ZPublisher, but ZServer uses its DebugLogger to log at 4 times: receipt of request, all data received, response returned from zope, all data sent back to client. Maybe you could monkeypatch DebugLogger to take the time of handoff to Zope (the 'I' line logged in continue_request) and insert it as a variable in the HTTPRequest, which you could then read and use to print your message from application code. Dunno how to meet your goal of tracking time across a redirect... unless maybe the redirect has a timestamp in the query string. -- Paul Winkler http://www.slinkp.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPublisher timing hooks ?
Hi all, I'd like to print a "this page was rendered in ... milliseconds" as you see on php sites. I think I'd get better accuracy by getting at least the start time from ZPublisher because.. actually it may not help, but I'm thinking about the case where a request generates a redirect and another request. I'd like to time the whole thing. Do you know if there are any facilities for this already in ZPublisher ? Any tips or pointers welcome. -Simon ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )