Skip to content

Commit cef3add

Browse files
pkg/collector/corechecks/cluster/ksm: add BenchmarkOwnerTags
1 parent 60eda69 commit cef3add

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/collector/corechecks/cluster/ksm/kubernetes_state_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,3 +1909,19 @@ func TestOwnerTags(t *testing.T) {
19091909
})
19101910
}
19111911
}
1912+
1913+
func BenchmarkOwnerTags(b *testing.B) {
1914+
b.Run("ReplicaSet", func(b *testing.B) {
1915+
b.ReportAllocs()
1916+
for b.Loop() {
1917+
_ = ownerTags("ReplicaSet", "foo-6768ddc4d")
1918+
}
1919+
})
1920+
1921+
b.Run("Job", func(b *testing.B) {
1922+
b.ReportAllocs()
1923+
for b.Loop() {
1924+
_ = ownerTags("Job", "foo-1627309500")
1925+
}
1926+
})
1927+
}

0 commit comments

Comments
 (0)