alexmojaki / heartrate

Simple real time visualisation of the execution of a Python program.
MIT License
1.76k stars 123 forks source link

[Feature Request] thread/multiprocessing traces #6

Open beasteers opened 3 years ago

beasteers commented 3 years ago

Omg first off, I just found this and I love this package!

I haven't looked into the source to see how feasible this would be, but it would be great to be able to visualize the stack traces for each running thread/subprocess. (I'm sure thread traces would be easier to handle than processes). This would be very useful in trying to debug where thread.join is hanging for example.

alexmojaki commented 3 years ago

Thanks, I'm glad you like it! I'm actually surprised how popular this library seems to be. I just thought it was a fun idea and hacked it together pretty quickly. I don't actually know how useful it really is, I've barely used it myself. Has it helped you in a real situation? Or is it mostly hypothetical?

Visualising each thread should be straightforward but would require significant work which I'm not willing to do. I can help with a PR though.

In the meantime you can trace multiple threads but you have to call trace for each thread and specify a unique port each time.

For your use case of trying to find out where a thread is getting stuck, consider my other library snoop.