con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

Create helper script (duct-suite plot?) to generate plots of memory/cpu through time #106

Open yarikoptic opened 1 week ago

yarikoptic commented 1 week ago

Might complement #105 nicely

I think with that we should initiate a helper "entry script" we could call duct-suite (or anything else) which would have support commands like this one to plot based on the stats collected for a process. Could probably be by default overlap of memory and CPU consumption with left "y" axis to have CPU and right - memory. Example for two graph plot with different scales: https://matplotlib.org/stable/gallery/subplots_axes_and_figures/two_scales.html

Then we can define extra-depends for the duct[suite] to use matplotlib etc as desired for the duct-suite.

Note that might want to code right away so we might later provide different plotting backends (may be for inclusion online etc)

asmacdo commented 1 week ago

I imagine the usage would look something like:

duct --output-prefix myprefix_ sleep 2
duct-suite render --matplotlib myprefix_usage.json

@yarikoptic does that match what you are thinking?

yarikoptic commented 1 week ago

yeap, something like that.

duct-suite render --backend matplotlib -o myprefix_usage.png myprefix_usage.json

and if no -o -- just display on screen. Eventually tricky part could become if we get various backends, and decide to get them backend specific options. For datalad-installer @jwodder ended up with quite evolved solution for smth like that. Hopefully we would not fall into such a rabbit hole here, just let's start somewhere ;-)

asmacdo commented 1 week ago

POC https://github.com/asmacdo/fancy-duct

(fake data)

resource_usage