Skip to content

Commit 66b689c

Browse files
authored
Merge pull request #950 from rylev/remove-unused-query-time
Remove unused self profile query time
2 parents 3436583 + 6405481 commit 66b689c

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

site/src/selector.rs

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,6 @@ impl SiteCtxt {
422422
) -> Result<Vec<SeriesResponse<SelfProfile>>, String> {
423423
SelfProfile::execute_query(artifact_ids, self, query.clone()).await
424424
}
425-
426-
pub async fn self_profile_query_time(
427-
&self,
428-
query: Query,
429-
artifact_ids: Arc<Vec<ArtifactId>>,
430-
) -> Result<Vec<SeriesResponse<SelfProfileQueryTime>>, String> {
431-
SelfProfileQueryTime::execute_query(artifact_ids, self, query.clone()).await
432-
}
433425
}
434426

435427
pub struct StatisticSeries {
@@ -647,88 +639,3 @@ impl Iterator for SelfProfile {
647639
self.artifact_ids.size_hint()
648640
}
649641
}
650-
651-
pub struct SelfProfileQueryTime {
652-
artifact_ids: ArtifactIdIter,
653-
points: std::vec::IntoIter<Option<f64>>,
654-
}
655-
656-
impl SelfProfileQueryTime {
657-
async fn new(
658-
artifact_ids: Arc<Vec<ArtifactId>>,
659-
ctxt: &SiteCtxt,
660-
benchmark: Benchmark,
661-
profile: Profile,
662-
scenario: Scenario,
663-
query: QueryLabel,
664-
) -> Self {
665-
let mut res = Vec::with_capacity(artifact_ids.len());
666-
let idx = ctxt.index.load();
667-
let mut conn = ctxt.conn().await;
668-
let mut tx = conn.transaction().await;
669-
let query = crate::db::DbLabel::SelfProfileQuery {
670-
benchmark,
671-
profile,
672-
scenario,
673-
query,
674-
};
675-
for aid in artifact_ids.iter() {
676-
let point = idx
677-
.get::<crate::db::QueryDatum>(tx.conn(), &query, aid)
678-
.await
679-
.map(|qd| qd.self_time.as_secs_f64());
680-
res.push(point);
681-
}
682-
tx.finish().await.unwrap();
683-
SelfProfileQueryTime {
684-
artifact_ids: ArtifactIdIter::new(artifact_ids),
685-
points: res.into_iter(),
686-
}
687-
}
688-
689-
async fn execute_query(
690-
artifact_ids: Arc<Vec<ArtifactId>>,
691-
ctxt: &SiteCtxt,
692-
mut query: Query,
693-
) -> Result<Vec<SeriesResponse<Self>>, String> {
694-
let benchmark = query.extract_as::<String>(Tag::Benchmark)?;
695-
let profile = query.extract_as::<Profile>(Tag::Profile)?;
696-
let scenario = query.extract_as::<Scenario>(Tag::Scenario)?;
697-
let ql = query.extract_as::<QueryLabel>(Tag::QueryLabel)?;
698-
query.assert_empty()?;
699-
700-
let index = ctxt.index.load();
701-
let mut series = index
702-
.all_query_series()
703-
.filter(|&&(b, p, s, q)| {
704-
benchmark.matches(b) && profile.matches(p) && scenario.matches(s) && ql.matches(q)
705-
})
706-
.collect::<Vec<_>>();
707-
708-
series.sort_unstable();
709-
710-
let mut res = Vec::with_capacity(series.len());
711-
for &(b, p, s, q) in series {
712-
res.push(SeriesResponse {
713-
series: SelfProfileQueryTime::new(artifact_ids.clone(), ctxt, b, p, s, q).await,
714-
path: Path::new()
715-
.set(PathComponent::Benchmark(b))
716-
.set(PathComponent::Profile(p))
717-
.set(PathComponent::Scenario(s))
718-
.set(PathComponent::QueryLabel(q)),
719-
});
720-
}
721-
Ok(res)
722-
}
723-
}
724-
725-
impl Iterator for SelfProfileQueryTime {
726-
type Item = (ArtifactId, Option<f64>);
727-
fn next(&mut self) -> Option<Self::Item> {
728-
Some((self.artifact_ids.next()?, self.points.next().unwrap()))
729-
}
730-
731-
fn size_hint(&self) -> (usize, Option<usize>) {
732-
self.artifact_ids.size_hint()
733-
}
734-
}

0 commit comments

Comments
 (0)