@@ -50,7 +50,7 @@ pub async fn handle_graph(
50
50
} ;
51
51
52
52
for ( idx, point) in points. iter ( ) . enumerate ( ) {
53
- series. points . push ( point. y ) ;
53
+ series. points . push ( point. value ) ;
54
54
if point. is_interpolated {
55
55
series. is_interpolated . insert ( idx as u16 ) ;
56
56
}
@@ -83,15 +83,15 @@ pub async fn handle_graph(
83
83
Ok ( resp)
84
84
}
85
85
86
- struct GraphData {
87
- y : f32 ,
86
+ struct GraphPoint {
87
+ value : f32 ,
88
88
is_interpolated : bool ,
89
89
}
90
90
91
91
async fn handle_graph_impl (
92
92
body : graph:: Request ,
93
93
ctxt : & SiteCtxt ,
94
- ) -> ServerResult < HashMap < String , HashMap < String , Vec < ( String , Vec < GraphData > ) > > > > {
94
+ ) -> ServerResult < HashMap < String , HashMap < String , Vec < ( String , Vec < GraphPoint > ) > > > > {
95
95
let range = ctxt. data_range ( body. start . clone ( ) ..=body. end . clone ( ) ) ;
96
96
let commits: Arc < Vec < _ > > = Arc :: new ( range. iter ( ) . map ( |c| c. clone ( ) . into ( ) ) . collect ( ) ) ;
97
97
@@ -112,7 +112,7 @@ async fn handle_graph_impl(
112
112
. into_iter ( )
113
113
. map ( |sr| {
114
114
sr. interpolate ( )
115
- . map ( |series| to_graph_data ( body. kind , series) . collect :: < Vec < _ > > ( ) )
115
+ . map ( |series| to_graph_points ( body. kind , series) . collect :: < Vec < _ > > ( ) )
116
116
} )
117
117
. collect :: < Vec < _ > > ( ) ;
118
118
@@ -182,7 +182,7 @@ async fn handle_graph_impl(
182
182
. collect ( ) ,
183
183
)
184
184
. map ( |( ( c, d) , i) | ( ( c, Some ( d. expect ( "interpolated" ) / against) ) , i) ) ;
185
- let graph_data = to_graph_data ( body. kind , averaged) . collect :: < Vec < _ > > ( ) ;
185
+ let graph_data = to_graph_points ( body. kind , averaged) . collect :: < Vec < _ > > ( ) ;
186
186
series. push ( selector:: SeriesResponse {
187
187
path : selector:: Path :: new ( )
188
188
. set ( PathComponent :: Benchmark ( "Summary" . into ( ) ) )
@@ -215,10 +215,10 @@ async fn handle_graph_impl(
215
215
Ok ( by_test_case)
216
216
}
217
217
218
- fn to_graph_data < ' a > (
218
+ fn to_graph_points < ' a > (
219
219
kind : GraphKind ,
220
220
points : impl Iterator < Item = ( ( ArtifactId , Option < f64 > ) , Interpolated ) > + ' a ,
221
- ) -> impl Iterator < Item = GraphData > + ' a {
221
+ ) -> impl Iterator < Item = GraphPoint > + ' a {
222
222
let mut first = None ;
223
223
let mut prev = None ;
224
224
points. map ( move |( ( _aid, point) , interpolated) | {
@@ -229,8 +229,8 @@ fn to_graph_data<'a>(
229
229
let previous_point = prev. unwrap_or ( point) ;
230
230
let percent_prev = ( point - previous_point) / previous_point * 100.0 ;
231
231
prev = Some ( point) ;
232
- GraphData {
233
- y : match kind {
232
+ GraphPoint {
233
+ value : match kind {
234
234
GraphKind :: Raw => point as f32 ,
235
235
GraphKind :: PercentRelative => percent_prev as f32 ,
236
236
GraphKind :: PercentFromFirst => percent_first as f32 ,
0 commit comments