Merge pull request #98 from mjarkk/fix-76

Add a limit to the c.StatsHistory
This commit is contained in:
Jesse Duffield 2019-07-06 09:26:03 +10:00 committed by GitHub
commit a5ec531b2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 (%)",