Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EDIT: This is one PR of two; this one adds CPU information.
At NERSC (where two of the three days of the Jupyter for HPC workshop in June was), we're interested in having nbresuse report more metrics besides memory usage.Also, when running on a shared login node on Cori, we would like the (recommended) memory limit for each user to be the total available memory divided by the number of current users.This PR would allow us to accomplish that by having nbresuse track more metrics (specifically other memory characteristics, CPU usage, and number of JupyterHub users), as well as allow people to define their own custom functions to calculate dynamic memory limits, whose import location can then be specified using the notebook config file.(An example custom function for dynamically calculating a memory limit can be found here; the README links to a video demo showing it work in practice.)It seems like these features might also be useful for other people, hence the reason for making this PR. Of course, the implementation is more than a little wonky, and any suggestions you have for improvement would be highly appreciated, even if merging into master ultimately isn't possible.This seems to work based on the testing I have done inside of a Docker image, see here. I still need to set everything up on Cori to test it there, although I don't see in advance why it wouldn't also work.------Maybe @shreddd could say more about why these features would be useful at NERSC, if that information would be helpful or useful to you @yuvipanda.