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