singularity
singularity copied to clipboard
Instance stats CPU usage
Is your feature request related to a problem? Please describe.
CPU usage of an instance should be shown in a percentage value, but is currently in nanoseconds.
Describe the solution you'd like
CPU usage is shown as a percentage, and updates continuously for each interval when #892 interactive monitoring is implemented.
Additional context
CPU usage percentage must be calculated over time, between two measurement points:
- Obtain the cpu usage in nanoseconds
- After a wait of 1 second (or other fixed duration), obtain the cpu usage in nanoseconds again.
- Compute CPU usage as the difference in nanoseconds used, divided by the total CPU nanoseconds available (the known duration)
This means that even in non-interactive mode, the instance stats command must take two observations of the resource usage of the container.