@@ -73,7 +73,7 @@ func parseContainerRestarts(data []byte, buildNumber int, testResult *BuildData)
7373 }
7474
7575 res := perftype.DataItem {Unit : "" , Labels : map [string ]string {"RestartCount" : "RestartCount" }, Data : restartsByContainer }
76- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , res )
76+ testResult .Builds . AddBuildData ( build , res )
7777}
7878
7979func parsePerfData (data []byte , buildNumber int , testResult * BuildData ) {
@@ -89,7 +89,7 @@ func parsePerfData(data []byte, buildNumber int, testResult *BuildData) {
8989 if testResult .Version == obj .Version {
9090 for i := range obj .DataItems {
9191 stripCount (& obj .DataItems [i ])
92- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , obj .DataItems [i ])
92+ testResult .Builds . AddBuildData ( build , obj .DataItems [i ])
9393 }
9494 }
9595}
@@ -142,8 +142,8 @@ func parseResourceUsageData(data []byte, buildNumber int, testResult *BuildData)
142142 cpu .Data [percentile ] = usage .CPU
143143 memory .Data [percentile ] = usage .Memory / (1024 * 1024 )
144144 }
145- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , cpu )
146- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , memory )
145+ testResult .Builds . AddBuildData ( build , cpu )
146+ testResult .Builds . AddBuildData ( build , memory )
147147 }
148148}
149149
@@ -164,7 +164,7 @@ func parseRequestCountData(data []byte, buildNumber int, testResult *BuildData)
164164 continue
165165 }
166166 stripCount (& obj .DataItems [i ])
167- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , obj .DataItems [i ])
167+ testResult .Builds . AddBuildData ( build , obj .DataItems [i ])
168168 }
169169 }
170170}
@@ -217,7 +217,7 @@ func parseApiserverRequestCount(data []byte, buildNumber int, testResult *BuildD
217217 continue
218218 }
219219 resultMap [key ] = & perfData
220- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , perfData )
220+ testResult .Builds . AddBuildData ( build , perfData )
221221 }
222222}
223223
@@ -245,7 +245,7 @@ func parseApiserverInitEventsCount(data []byte, buildNumber int, testResult *Bui
245245 }
246246 delete (perfData .Labels , "__name__" )
247247 perfData .Data ["InitEventsCount" ] = float64 (metric [i ].Value )
248- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , perfData )
248+ testResult .Builds . AddBuildData ( build , perfData )
249249 }
250250}
251251
@@ -296,15 +296,15 @@ func parseSchedulingLatency(testName string) func([]byte, int, *BuildData) {
296296 return
297297 }
298298 preemptionEvaluation := parseOperationLatency (obj .PreemptionEvaluationLatency , testName , "preemption_evaluation" )
299- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , preemptionEvaluation )
299+ testResult .Builds . AddBuildData ( build , preemptionEvaluation )
300300 e2eScheduling := parseOperationLatency (obj .E2eSchedulingLatency , testName , "e2eScheduling" )
301- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , e2eScheduling )
301+ testResult .Builds . AddBuildData ( build , e2eScheduling )
302302 scheduling := parseOperationLatency (obj .SchedulingLatency , testName , "scheduling" )
303- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , scheduling )
303+ testResult .Builds . AddBuildData ( build , scheduling )
304304
305305 for name , metric := range obj .FrameworkExtensionPointDuration {
306306 frameworkExtensionPointDuration := parseOperationLatency (metric , testName , name )
307- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , frameworkExtensionPointDuration )
307+ testResult .Builds . AddBuildData ( build , frameworkExtensionPointDuration )
308308 }
309309 }
310310}
@@ -332,7 +332,7 @@ func parseSchedulingThroughputCL(testName string) func([]byte, int, *BuildData)
332332 perfData .Data ["Perc99" ] = obj .Perc99
333333 perfData .Data ["Average" ] = obj .Average
334334 perfData .Data ["Max" ] = obj .Max
335- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , perfData )
335+ testResult .Builds . AddBuildData ( build , perfData )
336336 }
337337}
338338
@@ -393,7 +393,7 @@ func parseHistogramMetric(metricName string) func(data []byte, buildNumber int,
393393 perfData .Data ["<= " + bucket + "s" ] = float64 (buckerVal ) / float64 (count ) * 100
394394 }
395395 }
396- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , perfData )
396+ testResult .Builds . AddBuildData ( build , perfData )
397397 }
398398 }
399399}
@@ -439,5 +439,5 @@ func parseSystemPodMetrics(data []byte, buildNumber int, testResult *BuildData)
439439 },
440440 Data : restartCounts ,
441441 }
442- testResult .Builds [ build ] = append ( testResult . Builds [ build ] , perfData )
442+ testResult .Builds . AddBuildData ( build , perfData )
443443}
0 commit comments