Merge pull request #89 from vmarmol/remove-freezer-stats

Remove FreezerStats.
This commit is contained in:
Michael Crosby 2014-07-14 11:21:25 -07:00
commit fb67bb80b4
2 changed files with 3 additions and 30 deletions

View File

@ -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
}

View File

@ -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 {