pub struct VcsTrend {
pub trend_schema_version: u32,
pub vcs_schema_version: u32,
pub risk_score_version: u32,
pub long_window_days: u32,
pub recent_window_days: u32,
pub truncated_shallow_clone: bool,
pub as_of_points: Vec<i64>,
pub files: BTreeMap<String, Vec<Option<VcsTrendPoint>>>,
pub deltas: VcsTrendDeltas,
}vcs-git only.Expand description
Wire form of a historical metric trend (issue #333) — the single
serialized shape shared by bca vcs trend, POST /vcs/trend, and the
Python vcs_trend().
as_of_points lists the sample timestamps oldest-first; every file’s
array in files aligns to it 1:1, with a null element where the file
did not exist at that point. files is keyed by repository-relative
path and ordered lexicographically for deterministic output.
Fields§
§trend_schema_version: u32Trend-document shape version
(crate::vcs::TREND_SCHEMA_VERSION).
vcs_schema_version: u32Per-point metric-block shape version.
risk_score_version: u32Composite-formula version.
long_window_days: u32Long window length, in days (constant across points).
recent_window_days: u32Recent window length, in days (constant across points).
truncated_shallow_clone: boolWhether any sampled snapshot came from a shallow clone.
as_of_points: Vec<i64>Sample timestamps, oldest-first.
files: BTreeMap<String, Vec<Option<VcsTrendPoint>>>Per-file time series; null marks a point where the file was
absent.
deltas: VcsTrendDeltasThe most-improved / most-regressed files by risk delta.
Implementations§
Source§impl VcsTrend
impl VcsTrend
Sourcepub fn from_trend(trend: &Trend, top_files: usize, top_deltas: usize) -> Self
pub fn from_trend(trend: &Trend, top_files: usize, top_deltas: usize) -> Self
Project a compute-side crate::vcs::Trend into the wire shape,
keeping the top_files highest-risk files (by their most-recent
present risk_score; 0 keeps all) and the top_deltas
strongest movers in each delta list.