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

Function FromContext

pkg/querier/stats/stats.go:37–43  ·  view source on GitHub ↗

FromContext gets the Stats out of the Context. Returns nil if stats have not been initialised in the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

35// FromContext gets the Stats out of the Context. Returns nil if stats have not
36// been initialised in the context.
37func FromContext(ctx context.Context) *QueryStats {
38 o := ctx.Value(ctxKey)
39 if o == nil {
40 return nil
41 }
42 return o.(*QueryStats)
43}
44
45// IsEnabled returns whether stats tracking is enabled in the context.
46func IsEnabled(ctx context.Context) bool {

Callers 15

PriorityMethod · 0.92
RoundTripGRPCMethod · 0.92
PriorityMethod · 0.92
ProcessMethod · 0.92
queryIngesterStreamMethod · 0.92
StatsRendererFunction · 0.92
Test_StatsRendererFunction · 0.92
fetchSeriesFromStoresMethod · 0.92
rejectQueryOrSetPriorityFunction · 0.92
EncodeResponseMethod · 0.92
EncodeResponseMethod · 0.92

Calls 1

ValueMethod · 0.45