@@ -39,13 +39,13 @@ function* colorIterator() {
39
39
}
40
40
}
41
41
42
- const generateColoredValues = ( values ) => {
42
+ const generateColoredValues = ( values , key ) => {
43
43
const color_iterator = colorIterator ( )
44
- let last_commit_hash = null
44
+ let last_hash = null
45
45
let color = null ;
46
46
return values . map ( ( value ) => {
47
- if ( last_commit_hash != value . commit_hash ) {
48
- last_commit_hash = value . commit_hash
47
+ if ( last_hash != value [ key ] ) {
48
+ last_hash = value [ key ]
49
49
color = color_iterator . next ( ) . value
50
50
}
51
51
return { value : value . value , itemStyle : { color : color } }
@@ -159,15 +159,15 @@ const loadCharts = async () => {
159
159
let prun_id = null
160
160
161
161
phase_stats_data . forEach ( ( data ) => {
162
- let [ run_id , run_name , created_at , metric_name , detail_name , phase , value , unit , commit_hash , commit_timestamp ] = data
162
+ let [ run_id , run_name , created_at , metric_name , detail_name , phase , value , unit , commit_hash , commit_timestamp , gmt_hash ] = data
163
163
164
164
165
165
if ( series [ `${ metric_name } - ${ detail_name } ` ] == undefined ) {
166
166
series [ `${ metric_name } - ${ detail_name } ` ] = { labels : [ ] , values : [ ] , notes : [ ] , unit : unit , metric_name : metric_name , detail_name : detail_name }
167
167
}
168
168
169
169
series [ `${ metric_name } - ${ detail_name } ` ] . labels . push ( commit_timestamp )
170
- series [ `${ metric_name } - ${ detail_name } ` ] . values . push ( { value : value , commit_hash : commit_hash } )
170
+ series [ `${ metric_name } - ${ detail_name } ` ] . values . push ( { value : value , commit_hash : commit_hash , gmt_hash : gmt_hash } )
171
171
series [ `${ metric_name } - ${ detail_name } ` ] . notes . push ( {
172
172
run_name : run_name ,
173
173
created_at : created_at ,
@@ -176,6 +176,7 @@ const loadCharts = async () => {
176
176
phase : phase ,
177
177
run_id : run_id ,
178
178
prun_id : prun_id ,
179
+ gmt_hash : gmt_hash ,
179
180
} )
180
181
181
182
prun_id = run_id
@@ -203,7 +204,7 @@ const loadCharts = async () => {
203
204
204
205
const chart_instance = echarts . init ( element ) ;
205
206
206
- const my_values = generateColoredValues ( series [ my_series ] . values ) ;
207
+ const my_values = generateColoredValues ( series [ my_series ] . values , $ ( '.radio-coloring:checked' ) . val ( ) ) ;
207
208
208
209
let data_series = [ {
209
210
name : my_series ,
@@ -221,28 +222,25 @@ const loadCharts = async () => {
221
222
let options = getLineBarChartOptions ( [ ] , series [ my_series ] . labels , data_series , 'Time' , series [ my_series ] . unit , 'category' , null , false , null , true , false , true ) ;
222
223
223
224
options . tooltip = {
224
- trigger : 'item ' ,
225
+ triggerOn : 'click ' ,
225
226
formatter : function ( params , ticket , callback ) {
226
227
if ( series [ params . seriesName ] ?. notes == null ) return ; // no notes for the MovingAverage
227
228
return `<strong>${ series [ params . seriesName ] . notes [ params . dataIndex ] . run_name } </strong><br>
229
+ run_id: <a href="/stats.html?id=${ series [ params . seriesName ] . notes [ params . dataIndex ] . run_id } " target="_blank">${ series [ params . seriesName ] . notes [ params . dataIndex ] . run_id } </a><br>
228
230
date: ${ series [ params . seriesName ] . notes [ params . dataIndex ] . created_at } <br>
229
231
metric_name: ${ params . seriesName } <br>
230
232
phase: ${ series [ params . seriesName ] . notes [ params . dataIndex ] . phase } <br>
231
233
value: ${ numberFormatter . format ( series [ params . seriesName ] . values [ params . dataIndex ] . value ) } <br>
232
234
commit_timestamp: ${ series [ params . seriesName ] . notes [ params . dataIndex ] . commit_timestamp } <br>
233
- commit_hash: ${ series [ params . seriesName ] . notes [ params . dataIndex ] . commit_hash } <br>
235
+ commit_hash: <a href="${ $ ( "#uri" ) . text ( ) } /commit/${ series [ params . seriesName ] . notes [ params . dataIndex ] . commit_hash } " target="_blank">${ series [ params . seriesName ] . notes [ params . dataIndex ] . commit_hash } </a><br>
236
+ gmt_hash: <a href="https://github.com/green-coding-berlin/green-metrics-tool/commit/${ series [ params . seriesName ] . notes [ params . dataIndex ] . gmt_hash } " target="_blank">${ series [ params . seriesName ] . notes [ params . dataIndex ] . gmt_hash } </a><br>
237
+
234
238
<br>
235
- <i>Click to diff measurement with previous</i >
239
+ 👉 <a href="/compare.html?ids= ${ series [ params . seriesName ] . notes [ params . dataIndex ] . run_id } , ${ series [ params . seriesName ] . notes [ params . dataIndex ] . prun_id } " target="_blank">Diff with previous run</a >
236
240
` ;
237
241
}
238
242
} ;
239
243
240
- chart_instance . on ( 'click' , function ( params ) {
241
- if ( params . componentType != 'series' ) return ; // no notes for the MovingAverage
242
- window . open ( `/compare.html?ids=${ series [ params . seriesName ] . notes [ params . dataIndex ] . run_id } ,${ series [ params . seriesName ] . notes [ params . dataIndex ] . prun_id } ` , '_blank' ) ;
243
-
244
- } ) ;
245
-
246
244
options . dataZoom = {
247
245
show : false ,
248
246
start : 0 ,
0 commit comments