@@ -3,7 +3,7 @@ import {DASHBOARD_DATA_URL} from "../urls";
33
44import { getJson } from "../utils/requests" ;
55
6- interface DashboardCases {
6+ interface DashboardCompileBenchmarkCases {
77 clean_averages : [ number ] ;
88 base_incr_averages : [ number ] ;
99 clean_incr_averages : [ number ] ;
@@ -13,10 +13,11 @@ interface DashboardCases {
1313interface DashboardResponse {
1414 Ok : {
1515 versions : [ string ] ;
16- check : DashboardCases ;
17- debug : DashboardCases ;
18- opt : DashboardCases ;
19- doc : DashboardCases ;
16+ check : DashboardCompileBenchmarkCases ;
17+ debug : DashboardCompileBenchmarkCases ;
18+ opt : DashboardCompileBenchmarkCases ;
19+ doc : DashboardCompileBenchmarkCases ;
20+ runtime : [ number ] ;
2021 } ;
2122}
2223
@@ -25,7 +26,7 @@ type Profile = "check" | "debug" | "opt" | "doc";
2526function render (
2627 element : string ,
2728 name : Profile ,
28- data : DashboardCases ,
29+ data : DashboardCompileBenchmarkCases ,
2930 versions : [ string ]
3031) {
3132 let articles = { check : "a" , debug : "a" , opt : "an" , doc : "a" } ;
@@ -78,12 +79,44 @@ function render(
7879 } ) ;
7980}
8081
82+ function renderRuntime ( element : string , data : [ number ] , versions : [ string ] ) {
83+ Highcharts . chart ( {
84+ chart : {
85+ renderTo : element ,
86+ zooming : {
87+ type : "xy" ,
88+ } ,
89+ type : "line" ,
90+ } ,
91+ title : {
92+ text : `Average time for a runtime benchmark` ,
93+ } ,
94+ yAxis : {
95+ title : { text : "Seconds" } ,
96+ min : 0 ,
97+ } ,
98+ xAxis : {
99+ categories : versions ,
100+ title : { text : "Version" } ,
101+ } ,
102+ series : [
103+ {
104+ showInLegend : false ,
105+ type : "line" ,
106+ animation : false ,
107+ data,
108+ } ,
109+ ] ,
110+ } ) ;
111+ }
112+
81113function populate_data ( response : DashboardResponse ) {
82114 const data = response . Ok ;
83115 render ( "check-average-times" , "check" , data . check , data . versions ) ;
84116 render ( "debug-average-times" , "debug" , data . debug , data . versions ) ;
85117 render ( "opt-average-times" , "opt" , data . opt , data . versions ) ;
86118 render ( "doc-average-times" , "doc" , data . doc , data . versions ) ;
119+ renderRuntime ( "runtime-average-times" , data . runtime , data . versions ) ;
87120}
88121
89122async function make_data ( ) {
0 commit comments