pub struct DbQueryMetric {
pub backend: DbMetricBackend,
pub kind: DbQueryKind,
pub failed: bool,
pub elapsed: Duration,
}Expand description
Product-neutral database query metric emitted by database adapters.
This shape intentionally avoids exposing raw SQL to metrics recorders. Products should keep DB metrics low-cardinality and free of query parameters.
Fields§
§backend: DbMetricBackendDatabase backend that executed the query.
kind: DbQueryKindLow-cardinality query kind.
failed: boolWhether the query failed.
elapsed: DurationQuery duration observed by the database adapter.
Implementations§
Source§impl DbQueryMetric
impl DbQueryMetric
Sourcepub const fn new(
backend: DbMetricBackend,
kind: DbQueryKind,
failed: bool,
elapsed: Duration,
) -> Self
pub const fn new( backend: DbMetricBackend, kind: DbQueryKind, failed: bool, elapsed: Duration, ) -> Self
Creates a database query metric.
Sourcepub const fn status_label(&self) -> &'static str
pub const fn status_label(&self) -> &'static str
Returns the stable status label.
Trait Implementations§
Source§impl Clone for DbQueryMetric
impl Clone for DbQueryMetric
Source§fn clone(&self) -> DbQueryMetric
fn clone(&self) -> DbQueryMetric
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 moreSource§impl Debug for DbQueryMetric
impl Debug for DbQueryMetric
Source§impl PartialEq for DbQueryMetric
impl PartialEq for DbQueryMetric
Source§fn eq(&self, other: &DbQueryMetric) -> bool
fn eq(&self, other: &DbQueryMetric) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for DbQueryMetric
impl Eq for DbQueryMetric
impl StructuralPartialEq for DbQueryMetric
Auto Trait Implementations§
impl Freeze for DbQueryMetric
impl RefUnwindSafe for DbQueryMetric
impl Send for DbQueryMetric
impl Sync for DbQueryMetric
impl Unpin for DbQueryMetric
impl UnsafeUnpin for DbQueryMetric
impl UnwindSafe for DbQueryMetric
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.