From 66693196ac76202ca78d83998208278ea2f56b70 Mon Sep 17 00:00:00 2001 From: Abhinandan Prativadi Date: Wed, 27 Sep 2017 07:06:25 -0700 Subject: [PATCH] Setting timestamp for cpu and memory stats in nano seconds Signed-off-by: Abhinandan Prativadi --- pkg/server/container_stats_list.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/server/container_stats_list.go b/pkg/server/container_stats_list.go index f0db512bc..6711a3fa3 100644 --- a/pkg/server/container_stats_list.go +++ b/pkg/server/container_stats_list.go @@ -117,11 +117,11 @@ func (c *criContainerdService) getContainerMetrics( } metrics := s.(*cgroups.Metrics) cs.Cpu = &runtime.CpuUsage{ - Timestamp: stats.Timestamp.Unix(), + Timestamp: stats.Timestamp.UnixNano(), UsageCoreNanoSeconds: &runtime.UInt64Value{metrics.CPU.Usage.Total}, } cs.Memory = &runtime.MemoryUsage{ - Timestamp: stats.Timestamp.Unix(), + Timestamp: stats.Timestamp.UnixNano(), WorkingSetBytes: &runtime.UInt64Value{metrics.Memory.Usage.Usage}, } }