From 5f7bf3152652d36903f9659688321ae7c42995d0 Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Tue, 2 Feb 2021 12:45:25 -0800 Subject: Stub out basic `runsc events --stat` CPU functionality Because we lack gVisor-internal cgroups, we take the CPU usage of the entire pod and divide it proportionally according to sentry-internal usage stats. This fixes `kubectl top pods`, which gets a pod's CPU usage by summing the usage of its containers. Addresses #172. PiperOrigin-RevId: 355229833 --- runsc/cmd/events.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runsc/cmd/events.go') diff --git a/runsc/cmd/events.go b/runsc/cmd/events.go index 75b0aac8d..06f00e8e7 100644 --- a/runsc/cmd/events.go +++ b/runsc/cmd/events.go @@ -93,9 +93,9 @@ func (evs *Events) Execute(ctx context.Context, f *flag.FlagSet, args ...interfa // err must be preserved because it is used below when breaking // out of the loop. - b, err := json.Marshal(ev) + b, err := json.Marshal(ev.Event) if err != nil { - log.Warningf("Error while marshalling event %v: %v", ev, err) + log.Warningf("Error while marshalling event %v: %v", ev.Event, err) } else { os.Stdout.Write(b) } -- cgit v1.2.3