@@ -973,6 +973,20 @@ def generate_statistics(data, config, output_dir):
973973 "fill" : True ,
974974 "tension" : 0.1 ,
975975 })
976+ parallel_datasets_js = "," .join (
977+ (
978+ "{"
979+ f"label:{ json .dumps (ds ['label' ])} , "
980+ f"data:sliceData({ json .dumps (ds ['data' ])} ,30), "
981+ f"_allData:{ json .dumps (ds ['data' ])} , "
982+ f"borderColor:{ json .dumps (ds ['borderColor' ])} , "
983+ f"backgroundColor:{ json .dumps (ds ['backgroundColor' ])} , "
984+ f"fill:{ json .dumps (ds ['fill' ])} , "
985+ f"tension:{ json .dumps (ds ['tension' ])} "
986+ "}"
987+ )
988+ for ds in parallel_datasets
989+ )
976990
977991 # Build and test wait times per day
978992 build_wait_by_date = data .get ("build_wait_by_date" , {})
@@ -1143,6 +1157,10 @@ def generate_statistics(data, config, output_dir):
11431157const allMqCancelled = { json .dumps (mq_cancelled_per_day )} ;
11441158const allMqFailRate = { json .dumps (mq_fail_rate_per_day )} ;
11451159const allMqTat = { json .dumps (mq_avg_tat_per_day )} ;
1160+ const allQueueWaitAvg = { json .dumps (cap_avg_queue )} ;
1161+ const allQueueWaitP50 = { json .dumps (cap_p50_queue )} ;
1162+ const allQueueWaitP90 = { json .dumps (cap_p90_queue )} ;
1163+ const allQueueWaitP95 = { json .dumps (cap_p95_queue )} ;
11461164const hasMqData = { json .dumps (has_mq_data )} ;
11471165
11481166let charts = [];
@@ -1300,25 +1318,25 @@ def generate_statistics(data, config, output_dir):
13001318}});
13011319
13021320// Parallelization rate
1303- new Chart(document.getElementById('parallelRate_canvas').getContext('2d'), {{
1304- type: 'line',
1321+ makeChart('parallelRate_canvas', 'line', {{
13051322 data: {{
1306- labels: { json .dumps (dates )} ,
1307- datasets: { json .dumps (parallel_datasets )}
1323+ labels: sliceData(allLabels, 30),
1324+ datasets: [
1325+ { parallel_datasets_js }
1326+ ]
13081327 }},
13091328 options: {{responsive:true, scales:{{y:{{stacked:true,min:0,title:{{display:true,text:'Avg Concurrent Runners'}}}}}}}}
13101329}});
13111330
13121331// Queue wait time percentiles
1313- new Chart(document.getElementById('queueWait_canvas').getContext('2d'), {{
1314- type: 'line',
1332+ makeChart('queueWait_canvas', 'line', {{
13151333 data: {{
1316- labels: { json . dumps ( dates ) } ,
1334+ labels: sliceData(allLabels, 30) ,
13171335 datasets: [
1318- {{label:'Avg', data:{ json . dumps ( cap_avg_queue ) } , borderColor:'#0d6efd', fill:false, tension:0.1}},
1319- {{label:'p50', data:{ json . dumps ( cap_p50_queue ) } , borderColor:'#28a745', borderDash:[5,5], fill:false, tension:0.1}},
1320- {{label:'p90', data:{ json . dumps ( cap_p90_queue ) } , borderColor:'#ffc107', borderDash:[5,5], fill:false, tension:0.1}},
1321- {{label:'p95', data:{ json . dumps ( cap_p95_queue ) } , borderColor:'#dc3545', borderDash:[5,5], fill:false, tension:0.1}},
1336+ {{label:'Avg', data:sliceData(allQueueWaitAvg,30), _allData:allQueueWaitAvg , borderColor:'#0d6efd', fill:false, tension:0.1}},
1337+ {{label:'p50', data:sliceData(allQueueWaitP50,30), _allData:allQueueWaitP50 , borderColor:'#28a745', borderDash:[5,5], fill:false, tension:0.1}},
1338+ {{label:'p90', data:sliceData(allQueueWaitP90,30), _allData:allQueueWaitP90 , borderColor:'#ffc107', borderDash:[5,5], fill:false, tension:0.1}},
1339+ {{label:'p95', data:sliceData(allQueueWaitP95,30), _allData:allQueueWaitP95 , borderColor:'#dc3545', borderDash:[5,5], fill:false, tension:0.1}},
13221340 ]
13231341 }},
13241342 options: {{responsive:true, scales:{{y:{{title:{{display:true,text:'Minutes'}}}}}}}}
0 commit comments