Skip to content

Commit c8fcecc

Browse files
committed
More docs
1 parent 7f2f18e commit c8fcecc

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

site/src/comparison.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,16 @@ pub async fn compare_given_commits(
237237
Some(b) => b,
238238
None => return Ok(None),
239239
};
240-
let cids = Arc::new(vec![a.clone().into(), b.clone().into()]);
240+
let cids = Arc::new(vec![a.clone(), b.clone()]);
241241

242242
let query = selector::Query::new()
243243
.set::<String>(Tag::Crate, selector::Selector::All)
244244
.set::<String>(Tag::Cache, selector::Selector::All)
245245
.set::<String>(Tag::Profile, selector::Selector::All)
246246
.set(Tag::ProcessStatistic, selector::Selector::One(stat.clone()));
247247

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`
248250
let mut responses = data.query::<Option<f64>>(query, cids).await?;
249251

250252
let conn = data.conn().await;
@@ -257,18 +259,30 @@ pub async fn compare_given_commits(
257259
}))
258260
}
259261

260-
/// Data associated with a specific date
262+
/// Data associated with a specific artifact
261263
#[derive(Debug, Clone, Serialize)]
262264
pub struct DateData {
265+
/// The artifact in question
266+
pub commit: String,
267+
/// The date of the artifact if known
263268
pub date: Option<Date>,
269+
/// The pr of the artifact if known
264270
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)
266276
pub data: HashMap<String, Vec<(String, f64)>>,
267-
// crate -> nanoseconds
277+
/// Bootstrap data in the form "$crate" -> nanoseconds
268278
pub bootstrap: HashMap<String, u64>,
269279
}
270280

271281
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.
272286
async fn consume_one<'a, T>(
273287
conn: &dyn database::Connection,
274288
commit: ArtifactId,

0 commit comments

Comments
 (0)