pub struct PostgresMetrics<P: PoolAdapter> {
pub query_duration_seconds: HistogramVec,
pub rows_returned: HistogramVec,
/* private fields */
}Fields§
§query_duration_seconds: HistogramVec§rows_returned: HistogramVecImplementations§
Source§impl<P: PoolAdapter> PostgresMetrics<P>
impl<P: PoolAdapter> PostgresMetrics<P>
pub fn new(pool: P, config: CollectorConfig) -> Result<Self>
pub fn observe_query(&self, name: &str, duration_secs: f64, row_count: f64)
Trait Implementations§
Source§impl<P: PoolAdapter> Clone for PostgresMetrics<P>
impl<P: PoolAdapter> Clone for PostgresMetrics<P>
Source§impl<P: PoolAdapter> MetricsCollector for PostgresMetrics<P>
impl<P: PoolAdapter> MetricsCollector for PostgresMetrics<P>
fn name(&self) -> &'static str
fn register(&self, registry: &Registry) -> Result<()>
fn collect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn spawn_collect_loop(self: Arc<Self>, interval: Duration) -> JoinHandle<()>
Auto Trait Implementations§
impl<P> Freeze for PostgresMetrics<P>
impl<P> !RefUnwindSafe for PostgresMetrics<P>
impl<P> Send for PostgresMetrics<P>
impl<P> Sync for PostgresMetrics<P>
impl<P> Unpin for PostgresMetrics<P>
impl<P> UnsafeUnpin for PostgresMetrics<P>
impl<P> !UnwindSafe for PostgresMetrics<P>
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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read more