Skip to content

Feat; status page endpoint + ui skeleton #2224

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 8 commits into from
Aug 21, 2025
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
24 changes: 14 additions & 10 deletions database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl Ord for Commit {

/// The compilation profile (i.e., how the crate was built)
#[derive(
Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize,
Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Deserialize, serde::Serialize,
)]
pub enum Profile {
/// A checked build (i.e., no codegen)
Expand Down Expand Up @@ -356,9 +356,7 @@ impl PartialOrd for Scenario {
/// https://doc.rust-lang.org/nightly/rustc/platform-support.html
///
/// Presently we only support x86_64
#[derive(
Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Target {
/// `x86_64-unknown-linux-gnu`
X86_64UnknownLinuxGnu,
Expand Down Expand Up @@ -393,9 +391,7 @@ impl fmt::Display for Target {
}

/// The codegen backend used for compilation.
#[derive(
Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize,
)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum CodegenBackend {
/// The default LLVM backend
Llvm,
Expand Down Expand Up @@ -824,7 +820,7 @@ const BENCHMARK_REQUEST_STATUS_IN_PROGRESS_STR: &str = "in_progress";
const BENCHMARK_REQUEST_STATUS_COMPLETED_STR: &str = "completed";

impl BenchmarkRequestStatus {
pub(crate) fn as_str(&self) -> &str {
pub fn as_str(&self) -> &str {
match self {
Self::WaitingForArtifacts => BENCHMARK_REQUEST_STATUS_WAITING_FOR_ARTIFACTS_STR,
Self::ArtifactsReady => BENCHMARK_REQUEST_STATUS_ARTIFACTS_READY_STR,
Expand Down Expand Up @@ -986,6 +982,10 @@ impl BenchmarkRequest {
self.created_at
}

pub fn commit_date(&self) -> Option<DateTime<Utc>> {
self.commit_date
}

pub fn is_master(&self) -> bool {
matches!(self.commit_type, BenchmarkRequestType::Master { .. })
}
Expand Down Expand Up @@ -1100,8 +1100,8 @@ impl fmt::Display for BenchmarkJobStatus {
}
}

#[derive(Debug, Copy, Clone, PartialEq)]
pub struct BenchmarkSet(u32);
#[derive(Debug, Copy, Clone, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct BenchmarkSet(pub u32);

impl BenchmarkSet {
pub fn new(id: u32) -> Self {
Expand Down Expand Up @@ -1169,6 +1169,10 @@ impl BenchmarkJob {
pub fn status(&self) -> &BenchmarkJobStatus {
&self.status
}

pub fn created_at(&self) -> DateTime<Utc> {
self.created_at
}
}

/// Describes the final state of a job
Expand Down
4 changes: 4 additions & 0 deletions site/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
"source": "src/pages/status.ts",
"distDir": "dist/scripts"
},
"status_new": {
"source": "src/pages/status_new.ts",
"distDir": "dist/scripts"
},
"bootstrap": {
"source": "src/pages/bootstrap.ts",
"distDir": "dist/scripts"
Expand Down
8 changes: 8 additions & 0 deletions site/frontend/src/pages/status_new.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Status from "./status_new/page.vue";
import {createApp} from "vue";
import WithSuspense from "../components/with-suspense.vue";

const app = createApp(WithSuspense, {
component: Status,
});
app.mount("#app");
139 changes: 139 additions & 0 deletions site/frontend/src/pages/status_new/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
type BenchmarkRequestStatusComplete = {
state: "completed";
completedAt: string;
duration: number; // time in milliseconds
};

type BenchmarkRequestStatusInProgress = {
state: "in_progress";
};

type BenchmarkRequestStatusArtifactsReady = {
state: "artifacts_ready";
};

export type BenchmarkRequestStatus =
| BenchmarkRequestStatusComplete
| BenchmarkRequestStatusInProgress
| BenchmarkRequestStatusArtifactsReady;

type BenchmarkRequestTypeTry = {
type: "Try";
tag: string | null;
parent_sha: string | null;
pr: number;
};

type BenchmarkRequestTypeMaster = {
type: "Master";
tag: string;
parent_sha: string;
pr: number;
};

type BenchmarkRequestTypeRelease = {
type: "Try";
tag: string;
};

type BenchmarkRequestType =
| BenchmarkRequestTypeTry
| BenchmarkRequestTypeMaster
| BenchmarkRequestTypeRelease;

export type BenchmarkRequestComplete = {
status: BenchmarkRequestStatusComplete;
requestType: BenchmarkRequestType;
commitDate: string | null;
createdAt: string | null;
backends: string[];
profiles: string;
errors: string[];
};

export type BenchmarkRequestInProgress = {
status: BenchmarkRequestStatusInProgress;
requestType: BenchmarkRequestType;
commitDate: string | null;
createdAt: string | null;
backends: string[];
profiles: string;
errors: string[];
};

export type BenchmarkRequestArtifactsReady = {
status: BenchmarkRequestStatusArtifactsReady;
requestType: BenchmarkRequestType;
commitDate: string | null;
createdAt: string | null;
backends: string[];
profiles: string;
errors: string[];
};

export type BenchmarkRequest =
| BenchmarkRequestComplete
| BenchmarkRequestInProgress
| BenchmarkRequestArtifactsReady;

export type BenchmarkJobStatusQueued = {
state: "queued";
};

export type BenchmarkJobStatusInProgress = {
state: "in_progress";
startedAt: string;
collectorName: string;
};

export type BenchmarkJobStatusFailed = {
state: "failed";
startedAt: string;
completedAt: string;
collectorName: string;
};

export type BenchmarkJobStatusSuccess = {
state: "success";
startedAt: string;
completedAt: string;
collectorName: string;
};

export type BenchmarkJobStatus =
| BenchmarkJobStatusSuccess
| BenchmarkJobStatusFailed
| BenchmarkJobStatusInProgress
| BenchmarkJobStatusQueued;

export type BenchmarkJob = {
target: string;
backend: string;
profile: string;
requestTag: string;
benchmarkSet: number;
createdAt: string;
status: BenchmarkJobStatus;
dequeCounter: number;
};

export type CollectorConfig = {
name: string;
target: string;
benchmarkSet: number;
isActive: boolean;
lastHeartbeatAt: string;
dateAdded: string;
};

export type StatusResponseInProgress = {
request: BenchmarkRequestInProgress;
jobs: BenchmarkJob[];
};

export type StatusResponse = {
completed: BenchmarkRequestComplete[];
inProgress: StatusResponseInProgress[];
collectorConfigs: CollectorConfig[];
queue: BenchmarkRequest[];
};
Loading
Loading