From 3df6332a65b203b8fab106e9856a263f24b956a0 Mon Sep 17 00:00:00 2001 From: haircommander Date: Tue, 21 Aug 2018 16:32:21 -0400 Subject: Add GetPodStats to varlink Signed-off-by: haircommander Closes: #1319 Approved by: baude --- cmd/podman/varlink/io.podman.varlink | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'cmd/podman') diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink index 3d4a8fa84..2fc53b43e 100644 --- a/cmd/podman/varlink/io.podman.varlink +++ b/cmd/podman/varlink/io.podman.varlink @@ -757,8 +757,34 @@ method WaitPod() -> (notimplemented: NotImplemented) # This method has not been implemented yet. method TopPod() -> (notimplemented: NotImplemented) -# This method has not been implemented yet. -method StatsPod() -> (notimplemented: NotImplemented) +# GetPodStats takes the name or ID of a pod and returns a pod name and slice of ContainerStats structure which +# contains attributes like memory and cpu usage. If the pod cannot be found, a [PodNotFound](#PodNotFound) +# error will be returned. +# #### Example +# ~~~ +# $ varlink call unix:/run/podman/io.podman/io.podman.GetPodStats '{"name": "7f62b508b6f12b11d8fe02e"}' +# { +# "containers": [ +# { +# "block_input": 0, +# "block_output": 0, +# "cpu": 2.833470544016107524276e-08, +# "cpu_nano": 54363072, +# "id": "a64b51f805121fe2c5a3dc5112eb61d6ed139e3d1c99110360d08b58d48e4a93", +# "mem_limit": 12276146176, +# "mem_perc": 7.974359265237864966003e-03, +# "mem_usage": 978944, +# "name": "quirky_heisenberg", +# "net_input": 866, +# "net_output": 7388, +# "pids": 1, +# "system_nano": 20000000 +# } +# ], +# "pod": "7f62b508b6f12b11d8fe02e0db4de6b9e43a7d7699b33a4fc0d574f6e82b4ebd" +# } +# ~~~ +method GetPodStats(name: string) -> (pod: string, containers: []ContainerStats) # ImageNotFound means the image could not be found by the provided name or ID in local storage. error ImageNotFound (name: string) -- cgit v1.2.3-54-g00ecf