72
72
< h2 > Loading & rendering data..</ h2 >
73
73
< h3 > This may take a while!</ h3 >
74
74
</ div >
75
- < div id ="charts "> </ div >
75
+ < div id ="byCrateChart "> </ div >
76
+ < div id ="totalChart "> </ div >
76
77
< div id ="as-of "> </ div >
77
78
< a href ="https://github.com/rust-lang-nursery/rustc-perf ">
78
79
< img style ="position: absolute; top: 0; right: 0; border: 0; "
@@ -232,36 +233,50 @@ <h3>This may take a while!</h3>
232
233
}
233
234
234
235
function renderPlots ( data , state ) {
235
- let seriesOpts = [ { } ] ;
236
+ let byChartSeriesOpts = [ { } ] ;
236
237
237
238
let xVals = data . commits . map ( c => c [ 0 ] ) ;
238
- let plotData = [ xVals ] ;
239
+ let byChartPlotData = [ xVals ] ;
239
240
// https://sashamaps.net/docs/resources/20-colors/
240
241
let colors = [
241
242
'#e6194b' , '#3cb44b' , '#ffe119' , '#4363d8' , '#f58231' ,
242
243
'#911eb4' , '#46f0f0' , '#f032e6' , '#a09b13' , '#0ab0be' ,
243
244
'red' , 'green' , 'blue' , 'purple'
244
245
] ;
245
- let crates = Object . keys ( data . by_crate ) . sort ( ) ;
246
+ let crates = Object . keys ( data . by_crate_build_times ) . sort ( ) ;
246
247
for ( let crate of crates ) {
247
- plotData . push ( data . by_crate [ crate ] ) ;
248
+ byChartPlotData . push ( data . by_crate_build_times [ crate ] ) ;
248
249
249
- seriesOpts . push ( {
250
+ byChartSeriesOpts . push ( {
250
251
label : crate ,
251
252
stroke : colors . length ? colors . pop ( ) : 'black' ,
252
253
} ) ;
253
254
}
254
255
255
- let plotOpts = genPlotOpts ( {
256
- title : "Bootstrap timings for crates >= 30 seconds" ,
256
+ let byChartPlotOpts = genPlotOpts ( {
257
+ title : "Bootstrap time for crates >= 30 seconds" ,
257
258
width : Math . floor ( window . innerWidth ) - 16 ,
258
- height : window . innerHeight * 0.75 ,
259
+ height : window . innerHeight * 0.56 ,
259
260
yAxisLabel : "" ,
260
- series : seriesOpts ,
261
+ series : byChartSeriesOpts ,
261
262
commits : data . commits ,
262
263
} ) ;
263
264
264
- let u = new uPlot ( plotOpts , plotData , document . querySelector ( "#charts" ) ) ;
265
+ let byChartPlot = new uPlot ( byChartPlotOpts , byChartPlotData , document . querySelector ( "#byCrateChart" ) ) ;
266
+
267
+ let totalPlotData = [ xVals , data . total_build_times ] ;
268
+
269
+ let totalPlotOpts = genPlotOpts ( {
270
+ title : "Total bootstrap time" ,
271
+ width : Math . floor ( window . innerWidth ) - 16 ,
272
+ height : window . innerHeight * 0.26 ,
273
+ yAxisLabel : "" ,
274
+ series : [ { } , { label : "rustc" , stroke : '#7cb5ec' } ] ,
275
+ commits : data . commits ,
276
+ } ) ;
277
+
278
+ let totalPlot = new uPlot ( totalPlotOpts , totalPlotData , document . querySelector ( "#totalChart" ) ) ;
279
+
265
280
document . querySelector ( "#loading" ) . style . display = 'none' ;
266
281
}
267
282
@@ -291,4 +306,4 @@ <h3>This may take a while!</h3>
291
306
</ script >
292
307
</ body >
293
308
294
- </ html >
309
+ </ html >
0 commit comments