Remove FreezerStats.
They are really freezer state and we'll move them through another interface. Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
This commit is contained in:
parent
8c0303d928
commit
8de8fe9272
|
@ -1,8 +1,6 @@
|
||||||
package fs
|
package fs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -47,24 +45,6 @@ func (s *FreezerGroup) Remove(d *data) error {
|
||||||
return removePath(d.path("freezer"))
|
return removePath(d.path("freezer"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func getFreezerFileData(path string) (string, error) {
|
|
||||||
data, err := ioutil.ReadFile(path)
|
|
||||||
return strings.TrimSuffix(string(data), "\n"), err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *FreezerGroup) GetStats(path string, stats *cgroups.Stats) error {
|
func (s *FreezerGroup) GetStats(path string, stats *cgroups.Stats) error {
|
||||||
var (
|
|
||||||
data string
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
if data, err = getFreezerFileData(filepath.Join(path, "freezer.parent_freezing")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
stats.FreezerStats.ParentState = data
|
|
||||||
if data, err = getFreezerFileData(filepath.Join(path, "freezer.self_freezing")); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
stats.FreezerStats.SelfState = data
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,17 +55,10 @@ type BlkioStats struct {
|
||||||
SectorsRecursive []BlkioStatEntry `json:"sectors_recursive,omitempty"`
|
SectorsRecursive []BlkioStatEntry `json:"sectors_recursive,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(Vishh): Remove freezer from stats since it does not logically belong in stats.
|
|
||||||
type FreezerStats struct {
|
|
||||||
ParentState string `json:"parent_state,omitempty"`
|
|
||||||
SelfState string `json:"self_state,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Stats struct {
|
type Stats struct {
|
||||||
CpuStats CpuStats `json:"cpu_stats,omitempty"`
|
CpuStats CpuStats `json:"cpu_stats,omitempty"`
|
||||||
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
|
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
|
||||||
BlkioStats BlkioStats `json:"blkio_stats,omitempty"`
|
BlkioStats BlkioStats `json:"blkio_stats,omitempty"`
|
||||||
FreezerStats FreezerStats `json:"freezer_stats,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStats() *Stats {
|
func NewStats() *Stats {
|
||||||
|
|
Loading…
Reference in New Issue