MCPcopy
hub / github.com/flyteorg/flyte / NewTestScope

Function NewTestScope

flytestdlib/promutils/scope.go:571–573  ·  view source on GitHub ↗

NewTestScope returns a randomly-named scope for use in tests. Prometheus requires that metric names begin with a single word, which is generated from the alphabetic testScopeNameCharset.

()

Source from the content-addressed store, hash-verified

569// NewTestScope returns a randomly-named scope for use in tests.
570// Prometheus requires that metric names begin with a single word, which is generated from the alphabetic testScopeNameCharset.
571func NewTestScope() Scope {
572 return NewScope("test" + rand.String(6))
573}
574
575// DurationToString converts the duration to a string suffix that indicates the scale of the timer.
576func DurationToString(duration time.Duration) string {

Calls 2

NewScopeFunction · 0.85
StringMethod · 0.45