pub struct FeedbackSnapshotsRepository { /* private fields */ }Expand description
PostgreSQL persistence for retained snapshots, jobs, and coordinated
compaction.
Implementations§
Source§impl FeedbackSnapshotsRepository
impl FeedbackSnapshotsRepository
pub async fn request_range( &self, owner: &UserId, request: &SnapshotRangeRequest, now: DateTime<Utc>, ) -> Result<SnapshotRangeJob>
pub async fn range_job( &self, owner: &UserId, job: &AnalyticsSnapshotJobId, ) -> Result<Option<SnapshotRangeJob>>
pub async fn claim_range( &self, owner: &UserId, worker: &AnalyticsWorkerId, ) -> Result<Option<SnapshotJobLease>>
pub async fn complete_range( &self, owner: &UserId, lease: &SnapshotJobLease, now: DateTime<Utc>, ) -> Result<()>
pub async fn fail_range( &self, owner: &UserId, lease: &SnapshotJobLease, diagnostic: &str, ) -> Result<()>
Source§impl FeedbackSnapshotsRepository
impl FeedbackSnapshotsRepository
pub async fn refresh( &self, owner: &UserId, resources: &[ManagedResourceId], now: DateTime<Utc>, ) -> Result<i64>
pub async fn snapshot( &self, owner: &UserId, resource: Option<&ManagedResourceId>, window: u32, ) -> Result<Option<FeedbackSnapshot>>
pub async fn snapshots( &self, owner: &UserId, after: Option<&ManagedResourceId>, window: u32, limit: u32, ) -> Result<Vec<FeedbackSnapshot>>
pub async fn health(&self, owner: &UserId) -> Result<SnapshotHealth>
Source§impl FeedbackSnapshotsRepository
impl FeedbackSnapshotsRepository
pub async fn compact_in( tx: &mut Transaction<'_, Postgres>, owner: &UserId, now: DateTime<Utc>, ) -> Result<RetentionOutcome>
Source§impl FeedbackSnapshotsRepository
impl FeedbackSnapshotsRepository
pub async fn compact_all_in( tx: &mut Transaction<'_, Postgres>, now: DateTime<Utc>, ) -> Result<RetentionSummary>
Source§impl FeedbackSnapshotsRepository
impl FeedbackSnapshotsRepository
pub const fn new(pool: PgPool, facts: FeedbackFactsRepository) -> Self
Trait Implementations§
Source§impl Clone for FeedbackSnapshotsRepository
impl Clone for FeedbackSnapshotsRepository
Source§fn clone(&self) -> FeedbackSnapshotsRepository
fn clone(&self) -> FeedbackSnapshotsRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FeedbackSnapshotsRepository
impl !UnwindSafe for FeedbackSnapshotsRepository
impl Freeze for FeedbackSnapshotsRepository
impl Send for FeedbackSnapshotsRepository
impl Sync for FeedbackSnapshotsRepository
impl Unpin for FeedbackSnapshotsRepository
impl UnsafeUnpin for FeedbackSnapshotsRepository
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more