Duration returns the duration of the operation.
()
| 34 | |
| 35 | // Duration returns the duration of the operation. |
| 36 | func (e *ErrorInfo) Duration() time.Duration { |
| 37 | return e.EndTimestamp().Sub(e.StartTimestamp()) |
| 38 | } |
| 39 | |
| 40 | // NewErrorInfo creates a new ErrorInfo. |
| 41 | func NewErrorInfo(operation, operationDetails string, startTime, endTime time.Time, err error) *ErrorInfo { |