As for the CLI consuming one line and exiting I don’t have any plans for it. It was meant to be a simple way to quickly view stats for some containers, if you need more information or better control, hitting the API is your best bet because it provides much more information.
A single API endpoint for all container could be cool. If you feel like trying to contribute this go ahead
I definitely think having docker stats by its lonesome work in a similar way to htop would be super awesome, even if there are no plans for a non refreshing cli version.
I will have a look at doing a docker PR but it may take a bit, will consume the API for now.
It seems to be scaling it according to the number of CPUs its reporting, I wonder if this accounts for situations where the container is only allowed to work on 4/8 cpus
I did implement monitoring at:
The API seemed pretty straight forward though deciphering the meaning of the numbers was a bit rough cause I had to dig in to the source to figure it out, API docks are a bit thin.
Hardest thing was consuming the API in a non streaming way, it forced a pretty rough pattern and I worry that if there is a bug somewhere I am going to leak connections. I think a non-streaming option would be very helpful.