Is this project open to pull requests? I have added support for python multiprocessing and would like to hear your thoughts/feedback.
Currently, the panel extension gets disposed and recreated on every new pid and you cannot see the pids together in the graphs. This makes the extension not very usable when debugging a program that uses multiprocessing.
I've tested this on Linux and Mac OS with a python program that spawns multiple processes. All the spawned processes get monitored and data is shown in a different color. Colors are taken from the terminal styling.
The color is unique per pid, colors get reused after 12 processes. If you run a python program with only a single process, it will just use the color ansiGreen, so the default extension behavior stays the same.
Demo
Demo gif with multiprocessing
The colors seem to be flashing, this is not visible in VS Code for me.
![multiprocessing](https://user-images.githubusercontent.com/40422392/235362990-ba301eff-4fc1-4c03-a05e-79bb7bbbeaff.gif)
Changes:
extension.js:
Start monitoring every new process that gets spawned from the debug session. If the process gets terminated, stop monitoring the individual process.
Reuse the panel if it already exists. Keep the panel with values after you stop your debug session. Only create a new panel if you start a new debug session.
Handle stopped events and continue responses. If you pause your debugging or hit a breakpoint, it stops monitoring. I can remove this (or put in in a separate PR) but it was nice for my case to pause debugging and keep the results visible.
panel.js:
Added PidMonitor class which just holds all the variables that were already there. Every new pid that we monitor uses PidMonitor to track it's values.
I've split the IO graphs in two, because when multiple pids have read/writes the graph became very unclear. I can revert this. I'm curious what you think about this. It would be nice to be able to toggle between stacked/total/discrete display modes for the graphs.
Is this project open to pull requests? I have added support for python multiprocessing and would like to hear your thoughts/feedback.
Currently, the panel extension gets disposed and recreated on every new pid and you cannot see the pids together in the graphs. This makes the extension not very usable when debugging a program that uses multiprocessing.
I've tested this on Linux and Mac OS with a python program that spawns multiple processes. All the spawned processes get monitored and data is shown in a different color. Colors are taken from the terminal styling. The color is unique per pid, colors get reused after 12 processes. If you run a python program with only a single process, it will just use the color
ansiGreen
, so the default extension behavior stays the same.Demo
Demo gif with multiprocessing
The colors seem to be flashing, this is not visible in VS Code for me. ![multiprocessing](https://user-images.githubusercontent.com/40422392/235362990-ba301eff-4fc1-4c03-a05e-79bb7bbbeaff.gif)Changes:
extension.js
:stopped
events andcontinue
responses. If you pause your debugging or hit a breakpoint, it stops monitoring. I can remove this (or put in in a separate PR) but it was nice for my case to pause debugging and keep the results visible.panel.js
:Added
PidMonitor
class which just holds all the variables that were already there. Every new pid that we monitor usesPidMonitor
to track it's values.I've split the IO graphs in two, because when multiple pids have read/writes the graph became very unclear. I can revert this. I'm curious what you think about this. It would be nice to be able to toggle between stacked/total/discrete display modes for the graphs.