Skip to main content

AggregateWidget

Struct AggregateWidget 

Source
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: String

Tab 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: String

Widget heading. Required, validated non-empty.

§scope: AggregateScope

pc 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: String

obs_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: AggregateAgg

How 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: AggregateRender

Which widget the SPA draws. See AggregateRender.

Trait Implementations§

Source§

impl Clone for AggregateWidget

Source§

fn clone(&self) -> AggregateWidget

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AggregateWidget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AggregateWidget

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for AggregateWidget

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for AggregateWidget

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more