aboutsummaryrefslogtreecommitdiff
path: root/libpod/stats.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-06-20 13:23:24 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-29 20:44:09 +0000
commitb96be3af1b9d00662758211420c955becbaf2f9e (patch)
treed5cd7760de51bee819173a86317e1decbe0aa620 /libpod/stats.go
parent8d114ea4d81df474137b73a656012716500a2242 (diff)
downloadpodman-b96be3af1b9d00662758211420c955becbaf2f9e.tar.gz
podman-b96be3af1b9d00662758211420c955becbaf2f9e.tar.bz2
podman-b96be3af1b9d00662758211420c955becbaf2f9e.zip
changes to allow for darwin compilation
Signed-off-by: baude <bbaude@redhat.com> Closes: #1015 Approved by: baude
Diffstat (limited to 'libpod/stats.go')
-rw-r--r--libpod/stats.go35
1 files changed, 2 insertions, 33 deletions
diff --git a/libpod/stats.go b/libpod/stats.go
index 52bcc901d..262c1ac00 100644
--- a/libpod/stats.go
+++ b/libpod/stats.go
@@ -1,3 +1,5 @@
+// +build linux
+
package libpod
import (
@@ -6,29 +8,9 @@ import (
"time"
"github.com/containerd/cgroups"
- "github.com/containernetworking/plugins/pkg/ns"
- "github.com/cri-o/ocicni/pkg/ocicni"
"github.com/pkg/errors"
- "github.com/vishvananda/netlink"
)
-// ContainerStats contains the statistics information for a running container
-type ContainerStats struct {
- ContainerID string
- Name string
- CPU float64
- CPUNano uint64
- SystemNano uint64
- MemUsage uint64
- MemLimit uint64
- MemPerc float64
- NetInput uint64
- NetOutput uint64
- BlockInput uint64
- BlockOutput uint64
- PIDs uint64
-}
-
// GetContainerStats gets the running stats for a given container
func (c *Container) GetContainerStats(previousStats *ContainerStats) (*ContainerStats, error) {
stats := new(ContainerStats)
@@ -103,19 +85,6 @@ func getMemLimit(cgroupLimit uint64) uint64 {
return cgroupLimit
}
-func getContainerNetIO(ctr *Container) (*netlink.LinkStatistics, error) {
- var netStats *netlink.LinkStatistics
- err := ns.WithNetNSPath(ctr.state.NetNS.Path(), func(_ ns.NetNS) error {
- link, err := netlink.LinkByName(ocicni.DefaultInterfaceName)
- if err != nil {
- return err
- }
- netStats = link.Attrs().Statistics
- return nil
- })
- return netStats, err
-}
-
func calculateCPUPercent(stats *cgroups.Metrics, previousCPU, previousSystem uint64) float64 {
var (
cpuPercent = 0.0