fc-common: add build_metrics table and repository

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If6842311f49bfcba9e1b11fa8bc9748c6a6a6964
This commit is contained in:
raf 2026-02-08 21:36:19 +03:00
commit f8f9703faa
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
4 changed files with 126 additions and 0 deletions

View file

@ -164,6 +164,26 @@ pub struct BuildDependency {
pub dependency_build_id: Uuid,
}
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]
pub struct BuildMetric {
pub id: Uuid,
pub build_id: Uuid,
pub metric_name: String,
pub metric_value: f64,
pub unit: String,
pub collected_at: DateTime<Utc>,
}
pub mod metric_names {
pub const BUILD_DURATION_SECONDS: &str = "build_duration_seconds";
pub const OUTPUT_SIZE_BYTES: &str = "output_size_bytes";
}
pub mod metric_units {
pub const SECONDS: &str = "seconds";
pub const BYTES: &str = "bytes";
}
/// Active jobset view — enabled jobsets joined with project info.
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]
pub struct ActiveJobset {