Make stats gathering idempotent

This commit is contained in:
Alfonso Acosta
2016-08-16 12:50:22 +00:00
parent a4d5eb3d54
commit 8b97f12ab1
3 changed files with 3 additions and 2 deletions
+1
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)
+1 -1
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() {
+1 -1
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 {