Merge pull request #56 from vmarmol/fixes
Renaming StatsSummary to StatsPercentiles
This commit is contained in:
commit
27f7bd7152
@ -36,12 +36,12 @@ type ContainerHandler interface {
|
||||
ListContainers(listType ListType) ([]info.ContainerReference, error)
|
||||
ListThreads(listType ListType) ([]int, error)
|
||||
ListProcesses(listType ListType) ([]int, error)
|
||||
StatsSummary() (*info.ContainerStatsPercentiles, error)
|
||||
StatsPercentiles() (*info.ContainerStatsPercentiles, error)
|
||||
}
|
||||
|
||||
type NoStatsSummary struct {
|
||||
}
|
||||
|
||||
func (self *NoStatsSummary) StatsSummary() (*info.ContainerStatsPercentiles, error) {
|
||||
func (self *NoStatsSummary) StatsPercentiles() (*info.ContainerStatsPercentiles, error) {
|
||||
return nil, fmt.Errorf("This method (StatsSummary) should never be called")
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ func (self *percentilesContainerHandlerWrapper) ListProcesses(listType ListType)
|
||||
return self.handler.ListProcesses(listType)
|
||||
}
|
||||
|
||||
func (self *percentilesContainerHandlerWrapper) StatsSummary() (*info.ContainerStatsPercentiles, error) {
|
||||
func (self *percentilesContainerHandlerWrapper) StatsPercentiles() (*info.ContainerStatsPercentiles, error) {
|
||||
self.lock.Lock()
|
||||
defer self.lock.Unlock()
|
||||
samples := make([]*info.ContainerStatsSample, 0, self.sampler.Len())
|
||||
|
@ -65,7 +65,7 @@ func TestMaxMemoryUsage(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
summary, err := handler.StatsSummary()
|
||||
summary, err := handler.StatsPercentiles()
|
||||
if err != nil {
|
||||
t.Fatalf("Error when get summary: %v", err)
|
||||
}
|
||||
@ -164,7 +164,7 @@ func TestSampleCpuUsage(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
s, err := handler.StatsSummary()
|
||||
s, err := handler.StatsPercentiles()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ type ContainerInfo struct {
|
||||
// Historical statistics gathered from the container.
|
||||
Stats []*ContainerStats `json:"stats,omitempty"`
|
||||
|
||||
StatsSummary *ContainerStatsPercentiles `json:"stats_summary,omitempty"`
|
||||
StatsPercentiles *ContainerStatsPercentiles `json:"stats_summary,omitempty"`
|
||||
}
|
||||
|
||||
func (self *ContainerInfo) StatsAfter(ref time.Time) []*ContainerStats {
|
||||
|
@ -37,10 +37,10 @@ type containerStat struct {
|
||||
}
|
||||
type containerInfo struct {
|
||||
info.ContainerReference
|
||||
Subcontainers []info.ContainerReference
|
||||
Spec *info.ContainerSpec
|
||||
Stats *list.List
|
||||
StatsSummary *info.ContainerStatsPercentiles
|
||||
Subcontainers []info.ContainerReference
|
||||
Spec *info.ContainerSpec
|
||||
Stats *list.List
|
||||
StatsPercentiles *info.ContainerStatsPercentiles
|
||||
}
|
||||
|
||||
type containerData struct {
|
||||
@ -164,7 +164,7 @@ func (c *containerData) updateStats() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
summary, err := c.handler.StatsSummary()
|
||||
summary, err := c.handler.StatsPercentiles()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -180,7 +180,7 @@ func (c *containerData) updateStats() error {
|
||||
Timestamp: timestamp,
|
||||
Data: stats,
|
||||
})
|
||||
c.info.StatsSummary = summary
|
||||
c.info.StatsPercentiles = summary
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -130,9 +130,9 @@ func (m *manager) GetContainerInfo(containerName string) (*info.ContainerInfo, e
|
||||
Name: cinfo.Name,
|
||||
Aliases: cinfo.Aliases,
|
||||
},
|
||||
Subcontainers: cinfo.Subcontainers,
|
||||
Spec: cinfo.Spec,
|
||||
StatsSummary: cinfo.StatsSummary,
|
||||
Subcontainers: cinfo.Subcontainers,
|
||||
Spec: cinfo.Spec,
|
||||
StatsPercentiles: cinfo.StatsPercentiles,
|
||||
}
|
||||
|
||||
// Set default value to an actual value
|
||||
|
Loading…
Reference in New Issue
Block a user