mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-21 07:56:26 +01:00
be6da5053f
- Return meta-labels for the discovered targets via promutils.Labels instead of map[string]string. This improves the speed of generating meta-labels for discovered targets by up to 5x. - Remove memory allocations in hot paths during ScrapeWork generation. The ScrapeWork contains scrape settings for a single discovered target. This improves the service discovery speed by up to 2x.
22 lines
374 B
Go
22 lines
374 B
Go
package bytesutil
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestItoa(t *testing.T) {
|
|
f := func(n int, resultExpected string) {
|
|
t.Helper()
|
|
for i := 0; i < 5; i++ {
|
|
result := Itoa(n)
|
|
if result != resultExpected {
|
|
t.Fatalf("unexpected result for Itoa(%d); got %q; want %q", n, result, resultExpected)
|
|
}
|
|
}
|
|
}
|
|
f(0, "0")
|
|
f(1, "1")
|
|
f(-123, "-123")
|
|
f(343432, "343432")
|
|
}
|