Skip to content

Commit 59ec9ca

Browse files
Merge pull request #878 from rylev/rust-triage-generation
Rust triage generation api
2 parents cefd644 + 685f373 commit 59ec9ca

File tree

6 files changed

+628
-157
lines changed

6 files changed

+628
-157
lines changed

Cargo.lock

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ serde_json = "1"
1717
hyper = "0.13"
1818
headers = "0.3"
1919
http = "0.2"
20+
home = "0.5"
2021
chrono = "0.4"
2122
rmp-serde = "0.14.2"
2223
semver = "0.9"

site/src/api.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
//!
1414
//! The responses are calculated in the server.rs file.
1515
16-
use database::{Crate, Date};
16+
use database::Crate;
1717
use serde::{Deserialize, Serialize};
18-
use std::collections::HashMap;
1918
use std::fmt;
2019
use std::result::Result as StdResult;
2120

@@ -40,17 +39,6 @@ impl Serialize for StyledBenchmarkName {
4039
}
4140
}
4241

43-
/// Data associated with a specific date
44-
#[derive(Debug, Clone, Serialize)]
45-
pub struct DateData {
46-
pub date: Option<Date>,
47-
pub pr: Option<u32>,
48-
pub commit: String,
49-
pub data: HashMap<String, Vec<(String, f64)>>,
50-
// crate -> nanoseconds
51-
pub bootstrap: HashMap<String, u64>,
52-
}
53-
5442
pub type ServerResult<T> = StdResult<T, String>;
5543

5644
pub mod info {
@@ -92,7 +80,7 @@ pub struct CommitResponse {
9280
}
9381

9482
pub mod data {
95-
use crate::api::DateData;
83+
use crate::comparison::DateData;
9684
use collector::Bound;
9785
use serde::{Deserialize, Serialize};
9886

@@ -178,7 +166,7 @@ pub mod bootstrap {
178166
}
179167

180168
pub mod days {
181-
use crate::api::DateData;
169+
use crate::comparison::DateData;
182170
use collector::Bound;
183171
use serde::{Deserialize, Serialize};
184172

@@ -380,3 +368,17 @@ pub mod github {
380368
pub body: String,
381369
}
382370
}
371+
372+
pub mod triage {
373+
use collector::Bound;
374+
use serde::{Deserialize, Serialize};
375+
376+
#[derive(Debug, Clone, Serialize, Deserialize)]
377+
pub struct Request {
378+
pub start: Bound,
379+
pub end: Option<Bound>,
380+
}
381+
382+
#[derive(Debug, Clone, Serialize, Deserialize)]
383+
pub struct Response(pub String);
384+
}

0 commit comments

Comments
 (0)