From 8de8fe927203762bda80add0386a9924dacc770b Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Sun, 13 Jul 2014 16:14:05 -0700 Subject: [PATCH] Remove FreezerStats. They are really freezer state and we'll move them through another interface. Docker-DCO-1.1-Signed-off-by: Victor Marmol (github: vmarmol) --- cgroups/fs/freezer.go | 20 -------------------- cgroups/stats.go | 13 +++---------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/cgroups/fs/freezer.go b/cgroups/fs/freezer.go index 858f1aa7..db2a41ca 100644 --- a/cgroups/fs/freezer.go +++ b/cgroups/fs/freezer.go @@ -1,8 +1,6 @@ package fs import ( - "io/ioutil" - "path/filepath" "strings" "time" @@ -47,24 +45,6 @@ func (s *FreezerGroup) Remove(d *data) error { 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 { - 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 } diff --git a/cgroups/stats.go b/cgroups/stats.go index 2640245e..49913bce 100644 --- a/cgroups/stats.go +++ b/cgroups/stats.go @@ -55,17 +55,10 @@ type BlkioStats struct { 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 { - CpuStats CpuStats `json:"cpu_stats,omitempty"` - MemoryStats MemoryStats `json:"memory_stats,omitempty"` - BlkioStats BlkioStats `json:"blkio_stats,omitempty"` - FreezerStats FreezerStats `json:"freezer_stats,omitempty"` + CpuStats CpuStats `json:"cpu_stats,omitempty"` + MemoryStats MemoryStats `json:"memory_stats,omitempty"` + BlkioStats BlkioStats `json:"blkio_stats,omitempty"` } func NewStats() *Stats {