Documentation ¶
Index ¶
- Constants
- func FormatDuration(dur time.Duration) string
- func GetBigDelay() time.Duration
- func GetConnectSSHTimeout() time.Duration
- func GetConnectionTimeout() time.Duration
- func GetContextTimeout() time.Duration
- func GetDefaultDelay() time.Duration
- func GetExecutionTimeout() time.Duration
- func GetHostCleanupTimeout() time.Duration
- func GetHostCreationTimeout() time.Duration
- func GetHostTimeout() time.Duration
- func GetLongOperationTimeout() time.Duration
- func GetMinDelay() time.Duration
- func GetTimeoutFromEnv(key string, duration time.Duration) time.Duration
- type Stopwatch
Constants ¶
View Source
const ( // DefaultContextTimeout default timeout for grpc command invocation DefaultContextTimeout = 1 * time.Minute // HostTimeout timeout for grpc command relative to host creation HostTimeout = 5 * time.Minute // LongHostOperationTimeout is a Long timeout LongHostOperationTimeout = 10 * time.Minute // DefaultSSHConnectionTimeout is the default ssh timeout connection DefaultSSHConnectionTimeout = 2 * time.Minute // HostCleanupTimeout is the default timeout of host teardown operations HostCleanupTimeout = 3 * time.Minute // DefaultConnectionTimeout is the default connection timeout DefaultConnectionTimeout = 30 * time.Second // DefaultExecutionTimeout is the default linux command operation timeout DefaultExecutionTimeout = 5 * time.Minute // SmallDelay is the predefined small delay SmallDelay = 1 * time.Second // DefaultDelay is the default delay DefaultDelay = 5 * time.Second // BigDelay is a big delay BigDelay = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func GetHostCreationTimeout ¶
GetHostCreationTimeout ...
func GetLongOperationTimeout ¶
GetLongOperationTimeout ...
func GetTimeoutFromEnv ¶
GetTimeoutFromEnv reads a environment variable 'string', interprets the variable as a time.Duration if possible and returns the time to the caller if there is a failure, it returns a default duration 'duration' passed as an argument when calling the function
Types ¶
type Stopwatch ¶
type Stopwatch interface { // Start starts the stopwatch, either for the first time or after a Pause() Start() // Stop stops definitively the stopwatch, disabling the ability to start it again Stop() // Pause stops temporarily the stopwatch, allowing to start it again, suming up the time intervals Pause() // Duration returns the current elapsed time measured by the Stopwatch Duration() time.Duration // String returns a printable representation of the current elapsed time String() string // OnExitLogWithLevel returns a function that will log start and end of Stopwatch, intended tto be used with defer OnExitLogWithLevel(in, out string, level logrus.Level) func() // OnExitLogInfo OnExitLogInfo(in, out string) func() }
Stopwatch interface to expose methods available for a stopwatch
func NewStopwatch ¶
func NewStopwatch() Stopwatch
NewStopwatch creates a object satisfying interface Stopwatch
Click to show internal directories.
Click to hide internal directories.