Skip to content

Rust triage generation api #878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions site/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ serde_json = "1"
hyper = "0.13"
headers = "0.3"
http = "0.2"
home = "0.5"
chrono = "0.4"
rmp-serde = "0.14.2"
semver = "0.9"
Expand Down
32 changes: 17 additions & 15 deletions site/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
//!
//! The responses are calculated in the server.rs file.

use database::{Crate, Date};
use database::Crate;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::fmt;
use std::result::Result as StdResult;

Expand All @@ -40,17 +39,6 @@ impl Serialize for StyledBenchmarkName {
}
}

/// Data associated with a specific date
#[derive(Debug, Clone, Serialize)]
pub struct DateData {
pub date: Option<Date>,
pub pr: Option<u32>,
pub commit: String,
pub data: HashMap<String, Vec<(String, f64)>>,
// crate -> nanoseconds
pub bootstrap: HashMap<String, u64>,
}

pub type ServerResult<T> = StdResult<T, String>;

pub mod info {
Expand Down Expand Up @@ -92,7 +80,7 @@ pub struct CommitResponse {
}

pub mod data {
use crate::api::DateData;
use crate::comparison::DateData;
use collector::Bound;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -178,7 +166,7 @@ pub mod bootstrap {
}

pub mod days {
use crate::api::DateData;
use crate::comparison::DateData;
use collector::Bound;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -380,3 +368,17 @@ pub mod github {
pub body: String,
}
}

pub mod triage {
use collector::Bound;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Request {
pub start: Bound,
pub end: Option<Bound>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Response(pub String);
}
Loading