mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Added the sugestion from @jesseduffeild
This commit is contained in:
parent
8ef19b781d
commit
58baf82519
2 changed files with 7 additions and 6 deletions
|
|
@ -179,12 +179,7 @@ func (c *DockerCommand) createClientStatMonitor(container *Container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.ContainerMutex.Lock()
|
c.ContainerMutex.Lock()
|
||||||
toSlice := len(container.StatHistory) - 50
|
container.StatHistory = append(container.StatHistory, recordedStats)
|
||||||
if toSlice < 0 {
|
|
||||||
toSlice = 0
|
|
||||||
}
|
|
||||||
container.StatHistory = append(container.StatHistory[toSlice:], recordedStats)
|
|
||||||
|
|
||||||
container.EraseOldHistory()
|
container.EraseOldHistory()
|
||||||
c.ContainerMutex.Unlock()
|
c.ContainerMutex.Unlock()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,11 @@ type CustomCommand struct {
|
||||||
// the boolean zero value and this will be ignored when parsing the user's
|
// the boolean zero value and this will be ignored when parsing the user's
|
||||||
// config
|
// config
|
||||||
func GetDefaultConfig() UserConfig {
|
func GetDefaultConfig() UserConfig {
|
||||||
|
duration, err := time.ParseDuration("3m")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
return UserConfig{
|
return UserConfig{
|
||||||
Gui: GuiConfig{
|
Gui: GuiConfig{
|
||||||
ScrollHeight: 2,
|
ScrollHeight: 2,
|
||||||
|
|
@ -336,6 +341,7 @@ func GetDefaultConfig() UserConfig {
|
||||||
Method: "never",
|
Method: "never",
|
||||||
},
|
},
|
||||||
Stats: StatsConfig{
|
Stats: StatsConfig{
|
||||||
|
MaxDuration: duration,
|
||||||
Graphs: []GraphConfig{
|
Graphs: []GraphConfig{
|
||||||
{
|
{
|
||||||
Caption: "CPU (%)",
|
Caption: "CPU (%)",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue