diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-08 10:16:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-08 10:16:34 -0700 |
commit | 8eb03d3e5388d02dbbe5382b5fdb346a45535f84 (patch) | |
tree | 4bfe883e8e4f51af43b5c14c4e09fdaec889bc8d /pkg/varlinkapi/remote_client.go | |
parent | 1671ee557a6d354680be475991ca85a82f312a99 (diff) | |
parent | ba65301c955454e47c3893ca548f18a845a4c4a9 (diff) | |
download | podman-8eb03d3e5388d02dbbe5382b5fdb346a45535f84.tar.gz podman-8eb03d3e5388d02dbbe5382b5fdb346a45535f84.tar.bz2 podman-8eb03d3e5388d02dbbe5382b5fdb346a45535f84.zip |
Merge pull request #2746 from baude/remotecreate
podman-remote create|run
Diffstat (limited to 'pkg/varlinkapi/remote_client.go')
-rw-r--r-- | pkg/varlinkapi/remote_client.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pkg/varlinkapi/remote_client.go b/pkg/varlinkapi/remote_client.go new file mode 100644 index 000000000..dd0613494 --- /dev/null +++ b/pkg/varlinkapi/remote_client.go @@ -0,0 +1,29 @@ +// +build varlink remoteclient + +package varlinkapi + +import ( + "github.com/containers/libpod/cmd/podman/varlink" + "github.com/containers/libpod/libpod" +) + +// ContainerStatsToLibpodContainerStats converts the varlink containerstats to a libpod +// container stats +func ContainerStatsToLibpodContainerStats(stats iopodman.ContainerStats) libpod.ContainerStats { + cstats := libpod.ContainerStats{ + ContainerID: stats.Id, + Name: stats.Name, + CPU: stats.Cpu, + CPUNano: uint64(stats.Cpu_nano), + SystemNano: uint64(stats.System_nano), + MemUsage: uint64(stats.Mem_usage), + MemLimit: uint64(stats.Mem_limit), + MemPerc: stats.Mem_perc, + NetInput: uint64(stats.Net_input), + NetOutput: uint64(stats.Net_output), + BlockInput: uint64(stats.Block_input), + BlockOutput: uint64(stats.Block_output), + PIDs: uint64(stats.Pids), + } + return cstats +} |