mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +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()
|
||||
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()
|
||||
c.ContainerMutex.Unlock()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue