pub struct AggregateWidget {Show 15 fields
pub dashboard: String,
pub title: String,
pub scope: AggregateScope,
pub kind: String,
pub source: Option<String>,
pub agg: AggregateAgg,
pub group_by: Option<String>,
pub bool_path: Option<String>,
pub value_path: Option<String>,
pub transform: Option<AggregateTransform>,
pub sample_minutes: Option<u32>,
pub exclude: Vec<String>,
pub time_bucket: Option<AggregateTimeBucket>,
pub limit: Option<u32>,
pub render: AggregateRender,
}Expand description
#720 — one widget on the SPA Analytics page: a declarative
aggregation over the obs_events table. The backend reads these off
Manifest::aggregate (from BUCKET_JOBS) at query time and builds
the json_extract GROUP BY / time-bucket SQL from these generic
primitives, so an operator can chart any emitted event without a Rust
change. The reference shapes are the attendance dashboards
(presence / app_sample / web_visit), but the same DSL covers logon /
reboot / agent-health trends, etc.
Fields§
§dashboard: StringTab this widget lives under on the Analytics page. Widgets from every job are collected and grouped by this label, so the same string across jobs builds one multi-source dashboard. Required.
title: StringWidget heading. Required, validated non-empty.
scope: AggregateScopepc rolls up a single selected PC; fleet rolls up all PCs
(and unlocks group_by: pc_id to rank PCs against each other).
Defaults to pc.
kind: Stringobs_events.kind this widget reads (e.g. app_sample,
presence, unexpected_shutdown). Required.
source: Option<String>Optional obs_events.source filter, when one kind is emitted by
more than one collector.
agg: AggregateAggHow to roll the matching events up. See AggregateAgg.
group_by: Option<String>Dotted JSON path (no $. prefix) to group by for agg: count /
sum — e.g. foreground.app. The literal pc_id is special:
it groups by the pc_id column (fleet ranking), not a payload
field. Omit for a single total. Required when agg: sum needs a
breakdown; for agg: count omitting it yields the grand total.
bool_path: Option<String>Dotted JSON path to a boolean for agg: ratio (e.g. active):
the widget reports true_count / total. Required when agg: ratio.
value_path: Option<String>Dotted JSON path to a number for agg: sum. Required when agg: sum.
transform: Option<AggregateTransform>Optional value transform applied before grouping. Currently only
host (parse a URL down to its host) — used by the top-sites
widget, where SQLite can’t parse a URL so the backend does it in
Rust. See AggregateTransform.
sample_minutes: Option<u32>Optional sampling cadence in minutes. When set, a count is also
reported as estimated time (count × sample_minutes) — e.g. a
2-minute app sampler turns 11 samples into ~22 minutes. Must be ≥ 1.
exclude: Vec<String>Grouped values to drop from the rollup (e.g. ["LockApp"] so the
lock screen doesn’t top the app ranking). Empty by default.
time_bucket: Option<AggregateTimeBucket>Optional time bucketing — hour buckets events by local
hour-of-day for a timeline render. See AggregateTimeBucket.
limit: Option<u32>Top-N cap for grouped renders (bar). Defaults to 10 when unset.
render: AggregateRenderWhich widget the SPA draws. See AggregateRender.
Trait Implementations§
Source§impl Clone for AggregateWidget
impl Clone for AggregateWidget
Source§fn clone(&self) -> AggregateWidget
fn clone(&self) -> AggregateWidget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AggregateWidget
impl Debug for AggregateWidget
Source§impl<'de> Deserialize<'de> for AggregateWidget
impl<'de> Deserialize<'de> for AggregateWidget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AggregateWidget
impl JsonSchema for AggregateWidget
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more