podman-py icon indicating copy to clipboard operation
podman-py copied to clipboard

No support for fetching stats of all containers

Open RazCrimson opened this issue 2 years ago • 4 comments

Current Scenario podman-py currently does not directly provide any means to fetch the stats of all containers.

But this is allowed in as per the Podman REST API. Note that the containers parameter can take in multiple IDs or no ID to return data for all containers. The current method that uses this API Container.stats does not allow such actions.

Proposed Solution I propose to add an additional stats method under ContainerManager that would optionally take in cointainer_ids and stream the results.

Shall I go ahead and make a PR for this with the required changes or are there any other ways to implement this that would be considered better?

RazCrimson avatar Feb 18 '23 21:02 RazCrimson

@RazCrimson was this solved with your PR? (#237), or are there more bits to chase here?

TomSweeneyRedHat avatar Feb 22 '23 22:02 TomSweeneyRedHat

No, it not done. @TomSweeneyRedHat

My earlier PR was on Container.stats (stats for one container), but this issue is for a new but similar method under ContainerManager to stream stats for all containers.

Would it be fine to raise a PR to add that?

Also something else I noticed after I created this issue is that, there is no support to stream pod stats. PodManager.stats seems to be returning immediately (just one single response).

The latest podman docs mentions that it supports live streaming for pod stats but the API endpoint doesn't accept any stream params. Not sure if that is an inconsistency with the documentation. Will check and update here.

RazCrimson avatar Feb 23 '23 01:02 RazCrimson

Thanks for the clarification @RazCrimson . FWIW, PR's are always gratefully accepted!

TomSweeneyRedHat avatar Feb 23 '23 13:02 TomSweeneyRedHat

@RazCrimson thank yo for your contributions! Did your PRs address this issue or is there still some work left?

umohnani8 avatar Jan 23 '24 13:01 umohnani8