Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryStats ¶
type QueryStats struct {
Timings queryTimings `json:"timings,omitempty"`
}
QueryStats currently only holding query timings.
func NewQueryStats ¶
func NewQueryStats(tg *QueryTimers) *QueryStats
NewQueryStats makes a QueryStats struct with all QueryTimings found in the given TimerGroup.
type QueryTimers ¶
type QueryTimers struct {
*TimerGroup
}
func NewQueryTimers ¶
func NewQueryTimers() *QueryTimers
func (*QueryTimers) GetSpanTimer ¶
func (qs *QueryTimers) GetSpanTimer(ctx context.Context, qt QueryTiming, observers ...prometheus.Observer) (*SpanTimer, context.Context)
type QueryTiming ¶
type QueryTiming int
QueryTiming identifies the code area or functionality in which time is spent during a query.
const ( EvalTotalTime QueryTiming = iota ResultSortTime QueryPreparationTime InnerEvalTime ExecQueueTime ExecTotalTime )
Query timings.
func (QueryTiming) SpanOperation ¶
func (s QueryTiming) SpanOperation() string
Return a string representation of a QueryTiming span operation.
func (QueryTiming) String ¶
func (s QueryTiming) String() string
Return a string representation of a QueryTiming identifier.
type SpanTimer ¶
type SpanTimer struct {
// contains filtered or unexported fields
}
SpanTimer unifies tracing and timing, to reduce repetition.
func NewSpanTimer ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
A Timer that can be started and stopped and accumulates the total time it was running (the time between Start() and Stop()).
func (*Timer) ElapsedTime ¶
ElapsedTime returns the time that passed since starting the timer.
type TimerGroup ¶
type TimerGroup struct {
// contains filtered or unexported fields
}
A TimerGroup represents a group of timers relevant to a single query.
func (*TimerGroup) GetTimer ¶
func (t *TimerGroup) GetTimer(name fmt.Stringer) *Timer
GetTimer gets (and creates, if necessary) the Timer for a given code section.
func (*TimerGroup) String ¶
func (t *TimerGroup) String() string
Return a string representation of a TimerGroup.