@@ -237,14 +237,16 @@ pub async fn compare_given_commits(
237
237
Some ( b) => b,
238
238
None => return Ok ( None ) ,
239
239
} ;
240
- let cids = Arc :: new ( vec ! [ a. clone( ) . into ( ) , b. clone( ) . into ( ) ] ) ;
240
+ let cids = Arc :: new ( vec ! [ a. clone( ) , b. clone( ) ] ) ;
241
241
242
242
let query = selector:: Query :: new ( )
243
243
. set :: < String > ( Tag :: Crate , selector:: Selector :: All )
244
244
. set :: < String > ( Tag :: Cache , selector:: Selector :: All )
245
245
. set :: < String > ( Tag :: Profile , selector:: Selector :: All )
246
246
. set ( Tag :: ProcessStatistic , selector:: Selector :: One ( stat. clone ( ) ) ) ;
247
247
248
+ // This contains a series iterators. The first element in the iterator is the data for `a` and the
249
+ // second is the data for `b`
248
250
let mut responses = data. query :: < Option < f64 > > ( query, cids) . await ?;
249
251
250
252
let conn = data. conn ( ) . await ;
@@ -257,18 +259,30 @@ pub async fn compare_given_commits(
257
259
} ) )
258
260
}
259
261
260
- /// Data associated with a specific date
262
+ /// Data associated with a specific artifact
261
263
#[ derive( Debug , Clone , Serialize ) ]
262
264
pub struct DateData {
265
+ /// The artifact in question
266
+ pub commit : String ,
267
+ /// The date of the artifact if known
263
268
pub date : Option < Date > ,
269
+ /// The pr of the artifact if known
264
270
pub pr : Option < u32 > ,
265
- pub commit : String ,
271
+ /// Benchmark data in the form "$crate-$profile" -> Vec<("$cache", nanoseconds)>
272
+ ///
273
+ /// * $profile refers to the flavor of compilation like debug, doc, opt(timized), etc.
274
+ /// * $cache refers to how much of the compilation must be done and how much is cached
275
+ /// (e.g., "incr-unchanged" == compiling with full incremental cache and no code having changed)
266
276
pub data : HashMap < String , Vec < ( String , f64 ) > > ,
267
- // crate -> nanoseconds
277
+ /// Bootstrap data in the form "$ crate" -> nanoseconds
268
278
pub bootstrap : HashMap < String , u64 > ,
269
279
}
270
280
271
281
impl DateData {
282
+ /// For the given `ArtifactId`, consume the first datapoint in each of the given `SeriesResponse`
283
+ ///
284
+ /// It is assumed that the provided ArtifactId is the same as artifact id returned as the next data
285
+ /// point from all of the series `SeriesResponse`s. If this is not true, this function will panic.
272
286
async fn consume_one < ' a , T > (
273
287
conn : & dyn database:: Connection ,
274
288
commit : ArtifactId ,
0 commit comments