pub struct TelemetryStore { /* private fields */ }Expand description
SQLite-backed telemetry store (separate from graph.db).
Implementations§
Source§impl TelemetryStore
impl TelemetryStore
Sourcepub fn open(path: &Path) -> Result<Self, GraphError>
pub fn open(path: &Path) -> Result<Self, GraphError>
Open or create telemetry.db at the given path.
Sourcepub fn in_memory() -> Result<Self, GraphError>
pub fn in_memory() -> Result<Self, GraphError>
Create an in-memory telemetry store (for testing).
Sourcepub fn record(&self, event: &TelemetryEvent) -> Result<(), GraphError>
pub fn record(&self, event: &TelemetryEvent) -> Result<(), GraphError>
Record a single telemetry event.
Sourcepub fn recent_events(
&self,
limit: u32,
) -> Result<Vec<TelemetryEvent>, GraphError>
pub fn recent_events( &self, limit: u32, ) -> Result<Vec<TelemetryEvent>, GraphError>
Retrieve recent events, most recent first.
Sourcepub fn aggregate(&self, days: u32) -> Result<TelemetryAggregate, GraphError>
pub fn aggregate(&self, days: u32) -> Result<TelemetryAggregate, GraphError>
Aggregate telemetry over the last N days.
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