pub struct TelemetryStore {
pub events: Vec<TelemetryEvent>,
}Expand description
A telemetry store — append-only event log.
Fields§
§events: Vec<TelemetryEvent>Implementations§
Source§impl TelemetryStore
impl TelemetryStore
Sourcepub fn record(
&mut self,
actor: &str,
kind: EventKind,
requirement_id: Option<&str>,
)
pub fn record( &mut self, actor: &str, kind: EventKind, requirement_id: Option<&str>, )
Record a new event.
Sourcepub fn events_between(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Vec<&TelemetryEvent>
pub fn events_between( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<&TelemetryEvent>
Get events in a time range.
Sourcepub fn count_by_kind(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> HashMap<String, u32>
pub fn count_by_kind( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> HashMap<String, u32>
Count events by kind in a time range.
Sourcepub fn avg_cycle_time_hours(&self) -> Option<f64>
pub fn avg_cycle_time_hours(&self) -> Option<f64>
Calculate average cycle time (creation → completion) in hours.
Sourcepub fn summary(&self) -> UsageSummary
pub fn summary(&self) -> UsageSummary
Generate a usage summary report.
Trait Implementations§
Source§impl Clone for TelemetryStore
impl Clone for TelemetryStore
Source§fn clone(&self) -> TelemetryStore
fn clone(&self) -> TelemetryStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TelemetryStore
impl Debug for TelemetryStore
Source§impl Default for TelemetryStore
impl Default for TelemetryStore
Source§fn default() -> TelemetryStore
fn default() -> TelemetryStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TelemetryStore
impl<'de> Deserialize<'de> for TelemetryStore
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TelemetryStore
impl RefUnwindSafe for TelemetryStore
impl Send for TelemetryStore
impl Sync for TelemetryStore
impl Unpin for TelemetryStore
impl UnsafeUnpin for TelemetryStore
impl UnwindSafe for TelemetryStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more