Turn pkg/api/pod_example.json into go struct to avoid noise in pprof

This commit is contained in:
Dr. Stefan Schimanski
2016-07-08 14:25:11 +02:00
parent 61cde63622
commit d46cbfd3e0
3 changed files with 108 additions and 121 deletions

View File

@@ -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