MCPcopy Create free account
hub / github.com/cortexproject/cortex / IsEnabled

Function IsEnabled

pkg/querier/stats/stats.go:46–50  ·  view source on GitHub ↗

IsEnabled returns whether stats tracking is enabled in the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

44
45// IsEnabled returns whether stats tracking is enabled in the context.
46func IsEnabled(ctx context.Context) bool {
47 // When query statistics are enabled, the stats object is already initialised
48 // within the context, so we can just check it.
49 return FromContext(ctx) != nil
50}
51
52func (s *QueryStats) Copy() *QueryStats {
53 if s == nil {

Callers 3

RoundTripGRPCMethod · 0.92
ProcessMethod · 0.92
WrapMethod · 0.85

Calls 1

FromContextFunction · 0.70

Tested by

no test coverage detected