Documentation
¶
Index ¶
- Constants
- func FormatDuration(dur time.Duration) string
- func GetBigDelay() time.Duration
- func GetCommunicationTimeout() 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 GetMetadataReadAfterWriteTimeout() time.Duration
- func GetMetadataTimeout() time.Duration
- func GetMinDelay() time.Duration
- func GetOperationTimeout() time.Duration
- func GetTimeoutFromEnv(key string, duration time.Duration) time.Duration
- func MaxTimeout(a time.Duration, b time.Duration) time.Duration
- type Stopwatch
Constants ¶
View Source
const ( // DefaultContextTimeout default timeout for grpc command invocation DefaultContextTimeout = 1 * time.Minute // DefaultMetadataTimeout default timeout to handle object storage issues DefaultMetadataTimeout = 150 * time.Second // DefaultOperationTimeout default timeout to handle operations DefaultOperationTimeout = 120 * time.Second // HostTimeout timeout for grpc command relative to host creation HostTimeout = 6 * time.Minute // LongHostOperationTimeout is a Long timeout LongHostOperationTimeout = 14 * time.Minute // DefaultSSHConnectionTimeout is the default ssh timeout connection DefaultSSHConnectionTimeout = 3 * time.Minute // HostCleanupTimeout is the default timeout of host teardown operations HostCleanupTimeout = 5 * time.Minute // DefaultConnectionTimeout is the default connection timeout DefaultConnectionTimeout = 1 * time.Minute // DefaultExecutionTimeout is the default linux command operation timeout DefaultExecutionTimeout = 6 * time.Minute // DefaultMetadataReadAfterWriteTimeout is the default timeout applied to validate metadata write is effective DefaultMetadataReadAfterWriteTimeout = 90 * time.Second // 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 GetCommunicationTimeout ¶
GetCommunicationTimeout ...
func GetHostCreationTimeout ¶
GetHostCreationTimeout ...
func GetLongOperationTimeout ¶
GetLongOperationTimeout ...
func GetMetadataReadAfterWriteTimeout ¶
GetMetadataReadAfterWriteTimeout ...
func GetOperationTimeout ¶
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()
// GetDuration returns the current elapsed time measured by the Stopwatch
GetDuration() 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(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.