Merge pull request #395 from rjnagal/docker
Don't use state.json from libcontainer to get cgroup paths.
This commit is contained in:
commit
4d4aed792a
@ -295,7 +295,7 @@ func (self *dockerContainerHandler) GetStats() (stats *info.ContainerStats, err
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
stats, err = containerLibcontainer.GetStats(state)
|
stats, err = containerLibcontainer.GetStats(self.cgroupPaths, state)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -73,12 +73,12 @@ var supportedSubsystems map[string]struct{} = map[string]struct{}{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get stats of the specified container
|
// Get stats of the specified container
|
||||||
func GetStats(state *libcontainer.State) (*info.ContainerStats, error) {
|
func GetStats(cgroupPaths map[string]string, state *libcontainer.State) (*info.ContainerStats, error) {
|
||||||
// TODO(vmarmol): Use libcontainer's Stats() in the new API when that is ready.
|
// TODO(vmarmol): Use libcontainer's Stats() in the new API when that is ready.
|
||||||
stats := &libcontainer.ContainerStats{}
|
stats := &libcontainer.ContainerStats{}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
stats.CgroupStats, err = cgroupfs.GetStats(state.CgroupPaths)
|
stats.CgroupStats, err = cgroupfs.GetStats(cgroupPaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &info.ContainerStats{}, err
|
return &info.ContainerStats{}, err
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ func (self *rawContainerHandler) GetStats() (*info.ContainerStats, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stats, err := libcontainer.GetStats(&state)
|
stats, err := libcontainer.GetStats(self.cgroupPaths, &state)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user