mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
Merge pull request #1798 from weaveworks/1683-start-stats-idempotent
Make stats gathering idempotent
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user