pub struct DatabaseSizeMonitor { /* private fields */ }Expand description
Database size monitor
Implementations§
Source§impl DatabaseSizeMonitor
impl DatabaseSizeMonitor
Sourcepub fn new(config: SizeMonitorConfig) -> Self
pub fn new(config: SizeMonitorConfig) -> Self
Create a new database size monitor
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a monitor with default configuration
Sourcepub async fn collect_metrics(&self, pool: &PgPool) -> Result<DatabaseSnapshot>
pub async fn collect_metrics(&self, pool: &PgPool) -> Result<DatabaseSnapshot>
Collect current size metrics
Sourcepub async fn generate_report(&self, pool: &PgPool) -> Result<SizeReport>
pub async fn generate_report(&self, pool: &PgPool) -> Result<SizeReport>
Generate size monitoring report
Sourcepub fn get_history(&self) -> Vec<DatabaseSnapshot>
pub fn get_history(&self) -> Vec<DatabaseSnapshot>
Get historical snapshots
Sourcepub fn clear_history(&self)
pub fn clear_history(&self)
Clear all historical data
Auto Trait Implementations§
impl Freeze for DatabaseSizeMonitor
impl RefUnwindSafe for DatabaseSizeMonitor
impl Send for DatabaseSizeMonitor
impl Sync for DatabaseSizeMonitor
impl Unpin for DatabaseSizeMonitor
impl UnwindSafe for DatabaseSizeMonitor
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> 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