Merge pull request #1798 from weaveworks/1683-start-stats-idempotent

Make stats gathering idempotent
This commit is contained in:
Alfonso Acosta
2016-08-16 14:16:22 +01:00
committed by GitHub
3 changed files with 3 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ New features and enhancements:
[#1768](https://github.com/weaveworks/scope/pull/1768)
- Eliminate stats log noise from stopped containers
[#1687](https://github.com/weaveworks/scope/pull/1687)
[#1798](https://github.com/weaveworks/scope/pull/1798)
- Hide uncontained/unmanaged by default
[#1694](https://github.com/weaveworks/scope/pull/1694)

View File

@@ -181,7 +181,7 @@ func (c *container) StartGatheringStats() error {
defer c.Unlock()
if c.statsConn != nil {
return fmt.Errorf("already gather stats for container %s", c.container.ID)
return nil
}
go func() {

View File

@@ -360,7 +360,7 @@ func (r *registry) updateContainerState(containerID string, intendedState *strin
if r.collectStats {
if dockerContainer.State.Running {
if err := c.StartGatheringStats(); err != nil {
log.Errorf("Error gather stats for container: %s", containerID)
log.Errorf("Error gathering stats for container %s: %s", containerID, err)
return
}
} else {