MCPcopy
hub / github.com/dgraph-io/dgraph / WithMethod

Function WithMethod

x/metrics.go:598–602  ·  view source on GitHub ↗

WithMethod returns a new updated context with the tag KeyMethod set to the given value.

(parent context.Context, method string)

Source from the content-addressed store, hash-verified

596
597// WithMethod returns a new updated context with the tag KeyMethod set to the given value.
598func WithMethod(parent context.Context, method string) context.Context {
599 ctx, err := tag.New(parent, tag.Upsert(KeyMethod, method))
600 Check(err)
601 return ctx
602}
603
604// SinceMs returns the time since startTime in milliseconds (as a float).
605func SinceMs(startTime time.Time) float64 {

Callers 2

doQueryMethod · 0.92
proposeAndWaitMethod · 0.92

Calls 2

UpsertMethod · 0.80
CheckFunction · 0.70

Tested by

no test coverage detected