update to support newest libcontainer update
This commit is contained in:
parent
d1a2842b28
commit
b74d2c6296
@ -30,7 +30,7 @@ func GetStats(cgroup *cgroups.Cgroup, state *libcontainer.State) (*info.Containe
|
|||||||
stats := &libcontainer.ContainerStats{}
|
stats := &libcontainer.ContainerStats{}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
stats.CgroupStats, err = cgroupfs.GetStats(cgroup)
|
stats.CgroupStats, err = cgroupfs.GetStats(state.CgroupPaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &info.ContainerStats{}, err
|
return &info.ContainerStats{}, err
|
||||||
}
|
}
|
||||||
@ -43,14 +43,6 @@ func GetStats(cgroup *cgroups.Cgroup, state *libcontainer.State) (*info.Containe
|
|||||||
return toContainerStats(stats), nil
|
return toContainerStats(stats), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStatsCgroupOnly(cgroup *cgroups.Cgroup) (*info.ContainerStats, error) {
|
|
||||||
s, err := cgroupfs.GetStats(cgroup)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return toContainerStats(&libcontainer.ContainerStats{CgroupStats: s}), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func DiskStatsCopy(blkio_stats []cgroups.BlkioStatEntry) (stat []info.PerDiskStats) {
|
func DiskStatsCopy(blkio_stats []cgroups.BlkioStatEntry) (stat []info.PerDiskStats) {
|
||||||
if len(blkio_stats) == 0 {
|
if len(blkio_stats) == 0 {
|
||||||
return
|
return
|
||||||
|
@ -252,7 +252,6 @@ func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
|
|||||||
NetworkState: network.NetworkState{
|
NetworkState: network.NetworkState{
|
||||||
VethHost: self.networkInterface.VethHost,
|
VethHost: self.networkInterface.VethHost,
|
||||||
VethChild: self.networkInterface.VethChild,
|
VethChild: self.networkInterface.VethChild,
|
||||||
NsPath: "unknown",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user