summaryrefslogtreecommitdiff
path: root/cmd/podman/pod_stats.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-03-25 15:43:38 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-03-27 20:00:31 -0400
commit5ed62991dcbe85e28774b036a7c89033af80136f (patch)
treeea5b57abb6290bf0afac083292aad6dc653f52be /cmd/podman/pod_stats.go
parent340eeec1b654880f9d339c9ac2957bcaeaee6829 (diff)
downloadpodman-5ed62991dcbe85e28774b036a7c89033af80136f.tar.gz
podman-5ed62991dcbe85e28774b036a7c89033af80136f.tar.bz2
podman-5ed62991dcbe85e28774b036a7c89033af80136f.zip
Remove ulele/deepcopier in favor of JSON deep copy
We have a very high performance JSON library that doesn't need to perform code generation. Let's use it instead of our questionably performant, reflection-dependent deep copy library. Most changes because some functions can now return errors. Also converts cmd/podman to use jsoniter, instead of pkg/json, for increased performance. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cmd/podman/pod_stats.go')
-rw-r--r--cmd/podman/pod_stats.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/podman/pod_stats.go b/cmd/podman/pod_stats.go
index e8ff322ce..36b0b95ed 100644
--- a/cmd/podman/pod_stats.go
+++ b/cmd/podman/pod_stats.go
@@ -9,7 +9,6 @@ import (
"text/tabwriter"
"time"
- "encoding/json"
tm "github.com/buger/goterm"
"github.com/containers/buildah/pkg/formats"
"github.com/containers/libpod/cmd/podman/cliconfig"
@@ -17,7 +16,6 @@ import (
"github.com/containers/libpod/pkg/adapter"
"github.com/pkg/errors"
"github.com/spf13/cobra"
- "github.com/ulule/deepcopier"
)
var (
@@ -187,7 +185,9 @@ func podStatsCmd(c *cliconfig.PodStatsValues) error {
}
time.Sleep(time.Second)
previousPodStats := new([]*libpod.PodContainerStats)
- deepcopier.Copy(newStats).To(previousPodStats)
+ if err := libpod.JSONDeepCopy(newStats, previousPodStats); err != nil {
+ return err
+ }
pods, err = runtime.GetStatPods(c)
if err != nil {
return err