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.
()
| 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. |
| 571 | func 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. |
| 576 | func DurationToString(duration time.Duration) string { |