Skip to content

Commit a038e11

Browse files
committed
More docs
1 parent c8fcecc commit a038e11

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

database/src/lib.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,18 @@ impl Ord for Commit {
189189
}
190190
}
191191

192+
/// The compilation profile (i.e., how the crate was built)
192193
#[derive(
193194
Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize,
194195
)]
195196
pub enum Profile {
197+
/// A checked build (i.e., no codegen)
196198
Check,
199+
/// A debug build (i.e., low optimizations)
197200
Debug,
201+
/// A doc build
198202
Doc,
203+
/// An optimized "release" build
199204
Opt,
200205
}
201206

@@ -227,15 +232,23 @@ impl fmt::Display for Profile {
227232
}
228233
}
229234

235+
/// The incremental cache state
236+
///
237+
/// These are usually reported to users in a "flipped" way. For example,
238+
/// `Cache::Empty` means we're doing a "full" build. We present this to users as "full".
230239
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
231240
#[serde(tag = "variant", content = "name")]
232241
pub enum Cache {
242+
/// Empty cache (i.e., full build)
233243
#[serde(rename = "full")]
234244
Empty,
245+
/// Empty cache but still incremental (i.e., a full incremental build)
235246
#[serde(rename = "incr-full")]
236247
IncrementalEmpty,
248+
/// Cache is fully up-to-date (i.e., nothing has changed)
237249
#[serde(rename = "incr-unchanged")]
238250
IncrementalFresh,
251+
/// Cache is mostly up-to-date but something has been changed
239252
#[serde(rename = "incr-patched")]
240253
IncrementalPatch(PatchName),
241254
}
@@ -437,16 +450,26 @@ pub struct LabelId(pub u8, pub u32);
437450
#[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
438451
pub struct ArtifactIdNumber(pub u32);
439452

440-
/// Cached results of various queries.
453+
/// Id lookups for various things
454+
///
455+
/// This is a quick way to find what the database id for something
441456
#[derive(Debug, Clone, PartialEq, Eq, Default)]
442457
pub struct Index {
458+
/// Id look for a commit
443459
commits: Indexed<Commit>,
460+
/// Id lookup of the errors for a crate
444461
artifacts: Indexed<Box<str>>,
462+
/// Id lookup of the errors for a crate
445463
errors: Indexed<Crate>,
464+
/// Id lookup of a given process stastic profile
446465
pstats: Indexed<(Crate, Profile, Cache, ProcessStatistic)>,
466+
/// Id lookup of a given process query label
447467
queries: Indexed<(Crate, Profile, Cache, QueryLabel)>,
448468
}
449469

470+
/// An index lookup
471+
///
472+
/// Given a `T` find what its database id is
450473
#[derive(Debug, Clone, Serialize, Deserialize)]
451474
struct Indexed<T> {
452475
#[serde(with = "index_serde")]

site/src/comparison.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,15 @@ pub async fn compare_given_commits(
239239
};
240240
let cids = Arc::new(vec![a.clone(), b.clone()]);
241241

242+
// get all crates, cache, and profile combinations for the given stat
242243
let query = selector::Query::new()
243244
.set::<String>(Tag::Crate, selector::Selector::All)
244245
.set::<String>(Tag::Cache, selector::Selector::All)
245246
.set::<String>(Tag::Profile, selector::Selector::All)
246247
.set(Tag::ProcessStatistic, selector::Selector::One(stat.clone()));
247248

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`
249+
// `responses` contains a series iterators. The first element in the iterator is the data
250+
// for `a` and the second is the data for `b`
250251
let mut responses = data.query::<Option<f64>>(query, cids).await?;
251252

252253
let conn = data.conn().await;

0 commit comments

Comments
 (0)