reset container metrics on reader stop

This commit is contained in:
Bradley Cicenas 2017-03-06 02:05:34 +00:00
parent 38a1b305a7
commit 662d1d182b
2 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,7 @@ func (c *Container) Read(stream chan metrics.Metrics) {
c.Widgets.SetMetrics(metrics)
}
log.Infof("reader stopped for container: %s", c.Id)
c.Metrics = metrics.NewMetrics()
c.Widgets.Reset()
}()
log.Infof("reader started for container: %s", c.Id)

View File

@ -28,7 +28,7 @@ func (cs *MockContainerSource) Init() {
rand.Seed(int64(time.Now().Nanosecond()))
for i := 0; i < total; i++ {
time.Sleep(2 * time.Second)
time.Sleep(1 * time.Second)
collector := metrics.NewMock()
c := NewContainer(makeID(), collector)
c.SetName(makeName())