Skip to main content

Deadlocks? Detect where your threads hang in Python with one import.

Project description

Deadlocks? Detect where your threads hang in Python.

Build Status Python Package Index

Install

You can install the module with pip:

pip install hanging_threads

If you are under Windows, you can open the command line program “cmd” and type

py -m pip install hanging_threads

Usage

Starting monitoring as simple as calling the start_monitoring() function.

from hanging_threads import start_monitoring
monitoring_thread = start_monitoring()

You may also pass additional parameters.

monitoring_thread = start_monitoring(seconds_frozen=10, tests_per_second=10)

The values in the example are defaults. This mean the check will happen 10 times per second. If a thread is frozen for at least 10 seconds then the stack is dumped into standard error stream. This happens again every 10 seconds while there is no changes in the stack registered during checks.

Note that it makes sense to save the thread object into variable so that you or somebody else can stop this annoying dumps if needed. For example, you may want to do this in Python shell.

monitoring_thread.stop()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hanging_threads-2.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hanging_threads-2.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

hanging_threads-2.0.2-py2-none-any.whl (5.9 kB view details)

Uploaded Python 2

File details

Details for the file hanging_threads-2.0.2.tar.gz.

File metadata

File hashes

Hashes for hanging_threads-2.0.2.tar.gz
Algorithm Hash digest
SHA256 57d4f89922682ddab8615fb2185f6ce52912e73ad4ad0c2d693acc9a20554bfe
MD5 7ed7c530c47c3a4ce29b47286e30258c
BLAKE2b-256 7f14be5a948ebae33a4ead975908bd10f38cfec1692bef8c5a7683fa6ae253ff

See more details on using hashes here.

File details

Details for the file hanging_threads-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for hanging_threads-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d55e3b052a42e59367b347ec6f0b78d55846dd54a52ea9c85959e8393a48ec39
MD5 fc63f484b4a8b5c4d6527f54619aed78
BLAKE2b-256 2097ef2f055cd79896af2d88d4e8ab33df38b980196cf1a37c37c5ba23da5419

See more details on using hashes here.

File details

Details for the file hanging_threads-2.0.2-py2-none-any.whl.

File metadata

File hashes

Hashes for hanging_threads-2.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 d60825ac2477132a36bb836e8a2331600eda53d1aab7ee76a878e01eefa38263
MD5 54450a051f136f7b9c5bbacca3ee1343
BLAKE2b-256 7f9d437e23f2f2b05ffc98f23bbb9834994fb1ef55c93aa989121cfba7958a8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page