MCPcopy Create free account
hub / github.com/Shopify/goose / Duration

Method Duration

statsd/timer.go:17–20  ·  view source on GitHub ↗

Duration takes a time.Duration -- the time to complete the indicated operation -- and submits it to statsd. The last parameter is an arbitrary array of tags as maps.

(ctx context.Context, n time.Duration, ts ...Tags)

Source from the content-addressed store, hash-verified

15//
16// The last parameter is an arbitrary array of tags as maps.
17func (t *Timer) Duration(ctx context.Context, n time.Duration, ts ...Tags) {
18 tags := getStatsTags(ctx, ts...)
19 warnIfError(ctx, currentBackend.Distribution(ctx, t.Name, n.Seconds()*1000, tags, t.Rate.Rate()))
20}
21
22// Time runs a function, timing its execution, and submits the resulting
23// duration to statsd.

Callers 1

TimeMethod · 0.95

Calls 4

getStatsTagsFunction · 0.85
warnIfErrorFunction · 0.85
RateMethod · 0.80
DistributionMethod · 0.65

Tested by

no test coverage detected