Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorWrapper ¶
func ErrorWrapper(serviceable components.Serviceable, startTime time.Time, coldStartDone time.Time, gerr error) error
ErrorWrapper is an wraps an error in the cold start and execution of a serviceable. It handles the counter reporting for a serviceable based on its success and failures.
To use the startTime should always be the time the cold start began, in most cases this is when the matcher has been created/when a lookup request has been made. The coldStartDoneTime is always the time the cold start has been successfully completed. If there is an error during the cold start an empty time.Time (time.Time{}) should be used. The error is an error in either cold start, or execution.
If a cold start time is provided, and an error the counter that will be pushed is a successful cold start, with a failed execution. If a cold start time is provided, and a nil error the counter that will be pushed is a successful cold start and execution.
Types ¶
This section is empty.