@@ -3,21 +3,12 @@ use std::collections::HashMap;
3
3
use std:: sync:: Arc ;
4
4
5
5
use crate :: api:: graphs:: GraphKind ;
6
- use crate :: api:: { graph , graphs, ServerResult } ;
6
+ use crate :: api:: { graphs, ServerResult } ;
7
7
use crate :: db:: { self , ArtifactId , Profile , Scenario } ;
8
8
use crate :: interpolate:: IsInterpolated ;
9
9
use crate :: load:: SiteCtxt ;
10
10
use crate :: selector:: { CompileBenchmarkQuery , CompileTestCase , Selector , SeriesResponse } ;
11
11
12
- pub async fn handle_graph (
13
- request : graph:: Request ,
14
- ctxt : Arc < SiteCtxt > ,
15
- ) -> ServerResult < graph:: Response > {
16
- log:: info!( "handle_graph({:?})" , request) ;
17
-
18
- create_graph ( request, ctxt) . await
19
- }
20
-
21
12
pub async fn handle_graphs (
22
13
request : graphs:: Request ,
23
14
ctxt : Arc < SiteCtxt > ,
@@ -51,31 +42,6 @@ pub async fn handle_graphs(
51
42
Ok ( resp)
52
43
}
53
44
54
- async fn create_graph (
55
- request : graph:: Request ,
56
- ctxt : Arc < SiteCtxt > ,
57
- ) -> ServerResult < graph:: Response > {
58
- let artifact_ids = artifact_ids_for_range ( & ctxt, request. start , request. end ) ;
59
- let mut series_iterator = ctxt
60
- . statistic_series (
61
- CompileBenchmarkQuery :: default ( )
62
- . benchmark ( Selector :: One ( request. benchmark ) )
63
- . profile ( Selector :: One ( request. profile . parse ( ) ?) )
64
- . scenario ( Selector :: One ( request. scenario . parse ( ) ?) )
65
- . metric ( Selector :: One ( request. metric . parse ( ) ?) ) ,
66
- Arc :: new ( artifact_ids) ,
67
- )
68
- . await ?
69
- . into_iter ( )
70
- . map ( SeriesResponse :: interpolate) ;
71
-
72
- let result = series_iterator. next ( ) . unwrap ( ) ;
73
- let graph_series = graph_series ( result. series , request. kind ) ;
74
- Ok ( graph:: Response {
75
- series : graph_series,
76
- } )
77
- }
78
-
79
45
async fn create_graphs (
80
46
request : graphs:: Request ,
81
47
ctxt : & SiteCtxt ,
@@ -145,19 +111,6 @@ async fn create_graphs(
145
111
} ) )
146
112
}
147
113
148
- /// Returns artifact IDs for the given range.
149
- /// Inside of the range (not at the start/end), only master commits are kept.
150
- fn artifact_ids_for_range ( ctxt : & SiteCtxt , start : Bound , end : Bound ) -> Vec < ArtifactId > {
151
- let range = ctxt. data_range ( start..=end) ;
152
- let count = range. len ( ) ;
153
- range
154
- . into_iter ( )
155
- . enumerate ( )
156
- . filter ( |( index, commit) | * index == 0 || * index == count - 1 || commit. is_master ( ) )
157
- . map ( |c| c. 1 . into ( ) )
158
- . collect ( )
159
- }
160
-
161
114
/// Returns master commit artifact IDs for the given range.
162
115
fn master_artifact_ids_for_range ( ctxt : & SiteCtxt , start : Bound , end : Bound ) -> Vec < ArtifactId > {
163
116
ctxt. data_range ( start..=end)
0 commit comments