mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Turn pkg/api/pod_example.json into go struct to avoid noise in pprof
This commit is contained in:
@@ -38,15 +38,7 @@ func BenchmarkPodConversion(b *testing.B) {
|
||||
}
|
||||
|
||||
// add a fixed item
|
||||
data, err := ioutil.ReadFile("pod_example.json")
|
||||
if err != nil {
|
||||
b.Fatalf("Unexpected error while reading file: %v", err)
|
||||
}
|
||||
var pod api.Pod
|
||||
if err := runtime.DecodeInto(testapi.Default.Codec(), data, &pod); err != nil {
|
||||
b.Fatalf("Unexpected error decoding pod: %v", err)
|
||||
}
|
||||
items = append(items, pod)
|
||||
items = append(items, benchmarkPod)
|
||||
width := len(items)
|
||||
|
||||
scheme := api.Scheme
|
||||
|
||||
Reference in New Issue
Block a user