mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 00:21:04 +00:00
Added a litmit to the StatsHistory
This commit is contained in:
parent
787bff1102
commit
8ef19b781d
1 changed files with 6 additions and 1 deletions
|
|
@ -179,7 +179,12 @@ func (c *DockerCommand) createClientStatMonitor(container *Container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.ContainerMutex.Lock()
|
c.ContainerMutex.Lock()
|
||||||
container.StatHistory = append(container.StatHistory, recordedStats)
|
toSlice := len(container.StatHistory) - 50
|
||||||
|
if toSlice < 0 {
|
||||||
|
toSlice = 0
|
||||||
|
}
|
||||||
|
container.StatHistory = append(container.StatHistory[toSlice:], recordedStats)
|
||||||
|
|
||||||
container.EraseOldHistory()
|
container.EraseOldHistory()
|
||||||
c.ContainerMutex.Unlock()
|
c.ContainerMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue