Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Hack day project. Figure out if the main thread is hanging, and if so, what's causing it to hang.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 __init__.py
Octocat-spinner-32 setup.py
Octocat-spinner-32 test_hangwatcher.py
README.md

Usage

from twisted_hang import HangWatcher
watcher = HangWatcher(0.1, 0.5) # these params are optional. They have sane defaults
watcher.start()

Stuff will magically get printed out if the main thread hangs for more than MAX_DELAY seconds. If you want more info, add something like this after the lines above:

from twisted.internet import task
# Print stats every 60 seconds
lc = task.LoopingCall(watcher.print_stats)
lc.start(60)
Something went wrong with that request. Please try again.