mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
reset container metrics on reader stop
This commit is contained in:
parent
38a1b305a7
commit
662d1d182b
@ -67,6 +67,7 @@ func (c *Container) Read(stream chan metrics.Metrics) {
|
|||||||
c.Widgets.SetMetrics(metrics)
|
c.Widgets.SetMetrics(metrics)
|
||||||
}
|
}
|
||||||
log.Infof("reader stopped for container: %s", c.Id)
|
log.Infof("reader stopped for container: %s", c.Id)
|
||||||
|
c.Metrics = metrics.NewMetrics()
|
||||||
c.Widgets.Reset()
|
c.Widgets.Reset()
|
||||||
}()
|
}()
|
||||||
log.Infof("reader started for container: %s", c.Id)
|
log.Infof("reader started for container: %s", c.Id)
|
||||||
|
@ -28,7 +28,7 @@ func (cs *MockContainerSource) Init() {
|
|||||||
rand.Seed(int64(time.Now().Nanosecond()))
|
rand.Seed(int64(time.Now().Nanosecond()))
|
||||||
|
|
||||||
for i := 0; i < total; i++ {
|
for i := 0; i < total; i++ {
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
collector := metrics.NewMock()
|
collector := metrics.NewMock()
|
||||||
c := NewContainer(makeID(), collector)
|
c := NewContainer(makeID(), collector)
|
||||||
c.SetName(makeName())
|
c.SetName(makeName())
|
||||||
|
Loading…
Reference in New Issue
Block a user