MCPcopy
hub / github.com/prometheus/client_golang / New

Function New

exp/internal/github.com/efficientgo/core/backoff/backoff.go:34–41  ·  view source on GitHub ↗

New creates a Backoff object. Pass a Context that can also terminate the operation.

(ctx context.Context, cfg Config)

Source from the content-addressed store, hash-verified

32
33// New creates a Backoff object. Pass a Context that can also terminate the operation.
34func New(ctx context.Context, cfg Config) *Backoff {
35 return &Backoff{
36 cfg: cfg,
37 ctx: ctx,
38 nextDelayMin: cfg.Min,
39 nextDelayMax: doubleDuration(cfg.Min, cfg.Max),
40 }
41}
42
43// Reset the Backoff back to its initial condition.
44func (b *Backoff) Reset() {

Callers 2

WriteMethod · 0.92
TestBackoff_NextDelayFunction · 0.70

Calls 1

doubleDurationFunction · 0.85

Tested by 1

TestBackoff_NextDelayFunction · 0.56