MCPcopy Create free account
hub / github.com/deepflowio/deepflow / BenchmarkLabel_Add

Function BenchmarkLabel_Add

server/controller/prometheus/cache/cache_test.go:931–942  ·  view source on GitHub ↗

============================================================================ 第六部分:Benchmark — 性能基准 ============================================================================ --- label ---

(b *testing.B)

Source from the content-addressed store, hash-verified

929// --- label ---
930
931func BenchmarkLabel_Add(b *testing.B) {
932 for _, size := range []int{1000, 10_000, 100_000} {
933 batch := generateProtoLabels(size)
934 b.Run(fmt.Sprintf("n=%d", size), func(b *testing.B) {
935 for i := 0; i < b.N; i++ {
936 l := newTestLabel()
937 populateLabelDeps(l, size)
938 l.Add(batch)
939 }
940 })
941 }
942}
943
944func BenchmarkLabel_GetIDByKey(b *testing.B) {
945 for _, size := range benchmarkLabelLookupSizes() {

Callers

nothing calls this directly

Calls 5

generateProtoLabelsFunction · 0.85
newTestLabelFunction · 0.85
populateLabelDepsFunction · 0.85
RunMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected