Re: [Zope-dev] Tracking long-running requests
On Thu, Dec 08, 2005 at 09:23:47AM +, Chris Withers wrote: | Sidnei da Silva wrote: | >On Wed, Dec 07, 2005 at 10:13:36PM +0100, Dieter Maurer wrote: | >| And, as we speak about replacing Zope2's ZPublisher | >| by Zope3's Publisher, the old Zope2 ZPublisher will | >| probably not grow such hooks any more -- but hopefully, | >| the Zope3 Publisher will signal corresponding events. | > | >It already fires events at those places, if I'm not mistaken. | | "It" being Zope 2 or Zope 3's publisher? Does any released Zope 2 version have events support? Obviously it == Zope 3. -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Tracking long-running requests
Sidnei da Silva wrote: On Wed, Dec 07, 2005 at 10:13:36PM +0100, Dieter Maurer wrote: | And, as we speak about replacing Zope2's ZPublisher | by Zope3's Publisher, the old Zope2 ZPublisher will | probably not grow such hooks any more -- but hopefully, | the Zope3 Publisher will signal corresponding events. It already fires events at those places, if I'm not mistaken. "It" being Zope 2 or Zope 3's publisher? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Tracking long-running requests
On Wed, Dec 07, 2005 at 10:13:36PM +0100, Dieter Maurer wrote: | And, as we speak about replacing Zope2's ZPublisher | by Zope3's Publisher, the old Zope2 ZPublisher will | probably not grow such hooks any more -- but hopefully, | the Zope3 Publisher will signal corresponding events. It already fires events at those places, if I'm not mistaken. -- Sidnei da Silva Enfold Systems, LLC. http://enfoldsystems.com ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Tracking long-running requests
Chris Withers wrote at 2005-12-7 10:01 +: >> You err: I do want to see them in the logfile and >> I stole Florents idea to use "threadframe" (in his "DeadlockDebugger") >> to include a traceback for long running requests in the logfile. >> This way, it is >> easy not only to identify long running requests but also to >> get hints where they are spending their time... >> >> >> You will not believe how fast this has eliminated our remaining >> long running requests and especially to track down >> a non deterministic rarely occuring apparent deadlock situation... > >Is this code available anywhere? No. It relies on "ZPublisher.Publish" hacking in order to learn when requests get started and finished. Based on these "events", the set of currently worked on requests is maintained. An independent thread periodically monitors this set, identifies long running requests and calls configured handlers for them. The traceback logging handler looks like: from threadframe import dict as getFrames def handler(req, handlerState, globalState): threadId = req.threadId LOG('RequestMonitor.DumpTrace', WARNING, 'Long running request', 'Request %s "%s" running in thread %s since %ss\n%s' % ( req.id, req.info, threadId, handlerState.monitorTime - req.startTime, ''.join(formatStack(getFrames()[threadId])), ) ) Thus, for general availability, we would need "start_publishing" and "finish_publishing" hooks in "ZPublisher". And, as we speak about replacing Zope2's ZPublisher by Zope3's Publisher, the old Zope2 ZPublisher will probably not grow such hooks any more -- but hopefully, the Zope3 Publisher will signal corresponding events. > >cheers, > >Chris > >-- >Simplistix - Content Management, Zope & Python Consulting >- http://www.simplistix.co.uk > > -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org 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 )