Add a --fast-timing option to make things happen sooner
The smaller time scale is better for debugging
This commit is contained in:
parent
613e21597b
commit
70dc9702bd
@ -43,6 +43,7 @@ type environment struct {
|
|||||||
verbose bool
|
verbose bool
|
||||||
crash bool
|
crash bool
|
||||||
crashOnError bool
|
crashOnError bool
|
||||||
|
fastTiming bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// running stores whether the environment is currently running.
|
// running stores whether the environment is currently running.
|
||||||
@ -418,6 +419,7 @@ func (this *environment) applyConfig() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
// TODO: trim interval
|
||||||
err := parseDuration("init-timeout", &this.timing.initTimeout)
|
err := parseDuration("init-timeout", &this.timing.initTimeout)
|
||||||
if err != nil { return err }
|
if err != nil { return err }
|
||||||
err = parseDuration("restart-threshold", &this.timing.restartThreshold)
|
err = parseDuration("restart-threshold", &this.timing.restartThreshold)
|
||||||
@ -434,6 +436,12 @@ func (this *environment) applyConfig() error {
|
|||||||
if err != nil { return err }
|
if err != nil { return err }
|
||||||
err = parseDuration("shutdown-timeout", &this.timing.shutdownTimeout)
|
err = parseDuration("shutdown-timeout", &this.timing.shutdownTimeout)
|
||||||
if err != nil { return err }
|
if err != nil { return err }
|
||||||
|
|
||||||
|
if this.flags.fastTiming {
|
||||||
|
this.timing.shutdownTimeout.Store(this.timing.shutdownTimeout.Load() / 60)
|
||||||
|
// TODO: quicken trim interval
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
phases.go
10
phases.go
@ -24,9 +24,10 @@ func (this *environment) phase10FlagParsing() bool {
|
|||||||
flagUser := set.Flag('u', "user", "The user:group to run as", cli.ValString)
|
flagUser := set.Flag('u', "user", "The user:group to run as", cli.ValString)
|
||||||
flagLogDirectory := set.Flag('l', "log-directory", "Write logs to the specified directory", cli.ValString)
|
flagLogDirectory := set.Flag('l', "log-directory", "Write logs to the specified directory", cli.ValString)
|
||||||
flagConfigFile := set.Flag('c', "config-file", "Use this configuration file", cli.ValString)
|
flagConfigFile := set.Flag('c', "config-file", "Use this configuration file", cli.ValString)
|
||||||
flagVerbose := set.Flag('v', "verbose", "Enable verbose output/logging", nil)
|
flagVerbose := set.Flag('v', "verbose", "(debug) Enable verbose output/logging", nil)
|
||||||
flagCrash := set.Flag(0, "crash", "Crash when an actor panics", nil)
|
flagCrash := set.Flag(0, "crash", "(debug) Crash when an actor panics", nil)
|
||||||
flagCrashOnError := set.Flag(0, "crash-on-error", "Crash when an actor experiences any error", nil)
|
flagCrashOnError := set.Flag(0, "crash-on-error", "(debug) Crash when an actor experiences any error", nil)
|
||||||
|
flagFastTiming := set.Flag(0, "fast-timing", "(debug) Make timed things happen faster/more often", nil)
|
||||||
|
|
||||||
// ask actors to add flags
|
// ask actors to add flags
|
||||||
actors, done := this.actors.RBorrow()
|
actors, done := this.actors.RBorrow()
|
||||||
@ -70,6 +71,9 @@ func (this *environment) phase10FlagParsing() bool {
|
|||||||
this.flags.crash = true
|
this.flags.crash = true
|
||||||
this.flags.crashOnError = true
|
this.flags.crashOnError = true
|
||||||
}
|
}
|
||||||
|
if _, ok := flagFastTiming.First(); ok {
|
||||||
|
this.flags.fastTiming = true
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user