Documentation
¶
Overview ¶
Package spanstat provides a mechanism to measure duration of multiple spans and add them up to a total duration
Index ¶
- type SpanStat
- func (s *SpanStat) End(success bool) *SpanStat
- func (s *SpanStat) EndError(err error) *SpanStat
- func (s *SpanStat) FailureTotal() time.Duration
- func (s *SpanStat) Reset()
- func (s *SpanStat) Seconds() float64
- func (s *SpanStat) SetSuccessDuration(d time.Duration)
- func (s *SpanStat) Start() *SpanStat
- func (s *SpanStat) SuccessTotal() time.Duration
- func (s *SpanStat) Total() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpanStat ¶
type SpanStat struct {
// contains filtered or unexported fields
}
SpanStat measures the total duration of all time spent in between Start() and Stop() calls.
func (*SpanStat) End ¶
End ends the current span and adds the measured duration to the total cumulated duration, and to the success or failure cumulated duration depending on the given success flag
func (*SpanStat) FailureTotal ¶
FailureTotal returns the total duration of all unsuccessful spans measured
func (*SpanStat) Seconds ¶
Seconds returns the number of seconds represents by the spanstat. If a span is still open, it is closed first.
func (*SpanStat) SetSuccessDuration ¶
SetSuccessDuration sets the success duration of the SpanStat directly. This is useful for reconstructing timing data received from an external source (e.g., the standalone DNS proxy sending timing data via gRPC).
func (*SpanStat) SuccessTotal ¶
SuccessTotal returns the total duration of all successful spans measured