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

Method StartTimer

statsd/timer.go:82–89  ·  view source on GitHub ↗

StartTimer provides a way to collect a duration metric for a function call in one line. Examples: func foo() { defer t.StartTimer().Finish() // ... } func foo() (err error) { defer t.StartTimer().SuccessFinish(&err) // ... }

(ctx context.Context, ts ...Tags)

Source from the content-addressed store, hash-verified

80// // ...
81// }
82func (t *Timer) StartTimer(ctx context.Context, ts ...Tags) Finisher {
83 return &timerFinisher{
84 timer: t,
85 startTime: time.Now(),
86 tags: ts,
87 ctx: ctx,
88 }
89}

Callers 12

TestTimer_StartTimerFunction · 0.95
WaitMethod · 0.80
LookupHostMethod · 0.80
LookupIPAddrMethod · 0.80
LookupPortMethod · 0.80
LookupCNAMEMethod · 0.80
LookupSRVMethod · 0.80
LookupMXMethod · 0.80
LookupNSMethod · 0.80
LookupTXTMethod · 0.80
LookupAddrMethod · 0.80
RunAndWaitMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestTimer_StartTimerFunction · 0.76