vsoch / watchme

Reproducible watchers for research
https://vsoch.github.io/watchme/
Mozilla Public License 2.0
877 stars 32 forks source link

Add decorators to monitor process resource usage #40

Closed vsoch closed 5 years ago

vsoch commented 5 years ago

This is a new feature for watchme to be able to provide a decorator function to monitor resources for a process (typically a Python function) every N seconds. When used as a decorator, the function being wrapped is called, and watchme uses the pid to continually inspect the process, and save the result to a folder in the watcher specified by the user. The same function (to monitor a process) can also be added as a task, and this would work for any process running on the host (the user provides a process id or a process name to monitor). The complete docs are provided under the psutils watcher:

psutils-watchme.pdf

I'm wanting to add some more testing (across provided watchers, usage from command line) along with a "real world" example to monitor some scientific workflow (or similar) and then create some nice plots.

vsoch commented 5 years ago

https://pypi.org/project/watchme/0.0.19/