Skip to main content

systemprompt_analytics/snapshots/
mod.rs

1//! Durable aggregate snapshots, bounded range jobs and coordinated retention.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6mod daily;
7mod expiry;
8mod histogram;
9mod jobs;
10mod processing;
11mod ranges;
12mod reads;
13mod retention;
14mod retention_owners;
15mod types;
16pub use histogram::LatencyHistogram;
17pub use types::*;
18
19#[derive(Debug, Clone)]
20/// `PostgreSQL` persistence for retained snapshots, jobs, and coordinated
21/// compaction.
22pub struct FeedbackSnapshotsRepository {
23    pool: sqlx::PgPool,
24    facts: crate::feedback::FeedbackFactsRepository,
25}
26impl FeedbackSnapshotsRepository {
27    pub const fn new(pool: sqlx::PgPool, facts: crate::feedback::FeedbackFactsRepository) -> Self {
28        Self { pool, facts }
29    }
30}
31fn invalid(message: &str) -> crate::AnalyticsError {
32    crate::AnalyticsError::invalid_argument(message)
33}