pub struct MetricsRepo { /* private fields */ }Expand description
PostgreSQL repository for queue-level operational metrics.
§Examples
use azums::MetricsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let metrics = MetricsRepo::new(pool);
let _ = metrics;Implementations§
Source§impl MetricsRepo
§Examples
use azums::MetricsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let metrics = MetricsRepo::new(pool);
let _ = metrics;
impl MetricsRepo
§Examples
use azums::MetricsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let metrics = MetricsRepo::new(pool);
let _ = metrics;Sourcepub fn new(pool: Pool<Postgres>) -> MetricsRepo
pub fn new(pool: Pool<Postgres>) -> MetricsRepo
Creates a metrics repository backed by pool.
§Examples
use azums::MetricsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let metrics = MetricsRepo::new(pool);
let _ = metrics;Sourcepub async fn snapshot_all(&self) -> Result<Vec<Metrics>, Error>
pub async fn snapshot_all(&self) -> Result<Vec<Metrics>, Error>
Returns one metrics snapshot for every known queue.
§Examples
use azums::MetricsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let metrics = MetricsRepo::new(pool);
let _ = metrics;Sourcepub async fn snapshot_for_queue(&self, queue: &str) -> Result<Metrics, Error>
pub async fn snapshot_for_queue(&self, queue: &str) -> Result<Metrics, Error>
Calculates a metrics snapshot for one queue.
§Examples
use azums::MetricsRepo;
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.connect_lazy("postgres://postgres:postgres@localhost/azums")?;
let metrics = MetricsRepo::new(pool);
let _ = metrics;Trait Implementations§
Source§impl Clone for MetricsRepo
impl Clone for MetricsRepo
Source§fn clone(&self) -> MetricsRepo
fn clone(&self) -> MetricsRepo
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 MetricsRepo
impl !UnwindSafe for MetricsRepo
impl Freeze for MetricsRepo
impl Send for MetricsRepo
impl Sync for MetricsRepo
impl Unpin for MetricsRepo
impl UnsafeUnpin for MetricsRepo
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,
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