From cdbbd79155a7752843f2b420c3036ce6c390a3b6 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Wed, 21 Jul 2021 07:42:39 +0200 Subject: stats: add a interval parameter to cli and api stream mode podman stats polled by default in a 1 sec period. This can put quite some load on a machine if you run many containers. The default value is now 5 seconds. You can change this interval with a new, optional, --interval, -i cli flag. The api request got also a interval query parameter for the same purpose. Additionally a unused const was removed. Api and cli will fail the request if a 0 or negative value is passed in. Signed-off-by: Thomas Weber --- pkg/api/server/register_containers.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/api/server') diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go index 50e059ecc..5a4137533 100644 --- a/pkg/api/server/register_containers.go +++ b/pkg/api/server/register_containers.go @@ -1106,6 +1106,11 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error { // type: boolean // default: true // description: Stream the output + // - in: query + // name: interval + // type: integer + // default: 5 + // description: Time in seconds between stats reports // produces: // - application/json // responses: -- cgit v1.2.3-54-g00ecf