[Twisted-Python] Capture blocking calls?

Michael Twomey micktwomey at gmail.com
Tue Jun 21 05:40:54 EDT 2005


I've tried it out too and it seems to work well (I have to also
commend Jp on the sneakiness of the signal approach).

Since I don't have the dl module with my copy of mac python I've
attached a small patch which makes btt use the itimer module py-itimer
(http://www.cute.fi/~torppa/py-itimer/) if it can't import dl.


On 6/16/05, Ian Duggan <ian at ianduggan.net> wrote:
> On Tuesday 14 June 2005 18:17, Jp Calderone wrote:
> > >Does anyone know of any tools that could be used to wrap a python module
> > > and capture/report blocking calls made by it?
> >
> > <http://svn.twistedmatrix.com/cvs/sandbox/exarkun/btt.py> (and
> > <http://svn.twistedmatrix.com/cvs/sandbox/exarkun/test_btt.py>) might be of
> > interest/use.  I haven't done much with it yet, so I don't know if it's
> > actually effective.  I'd be interested to hear if you have any luck with
> > it.
> Heh, this is a very clever trick, setting and disabling an alarm in a looping
> call. If it doesn't get disabled in time, it tells you where the stack is. It
> actually works great! I was able to immediately test it by suspending twisted
> for a moment.
> I had to tune the precisions it was using, to prevent it from firing
> spuriously when my laptop got busy, but otherwise it's very cool. I love
> simple.
> Suggestions for anyone else who uses this:
> 1) Tune the precisions so that you have a quiet baseline.
> 2) If the network you are interacting with is too fast, find a way to throttle
> your connection.
> http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Adv-Routing-HOWTO.html
> --Ian
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
A non-text attachment was scrubbed...
Name: py-itimer.patch
Type: application/octet-stream
Size: 1206 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20050621/e5df49a2/attachment.obj 

More information about the Twisted-Python mailing list