pub struct DeploymentMetrics {
pub id: Uuid,
pub hosted_mock_id: Uuid,
pub period_start: NaiveDate,
pub requests: i64,
pub requests_2xx: i64,
pub requests_4xx: i64,
pub requests_5xx: i64,
pub egress_bytes: i64,
pub avg_response_time_ms: i64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Deployment metrics
Fields§
§id: Uuid§hosted_mock_id: Uuid§period_start: NaiveDate§requests: i64§requests_2xx: i64§requests_4xx: i64§requests_5xx: i64§egress_bytes: i64§avg_response_time_ms: i64§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl DeploymentMetrics
impl DeploymentMetrics
Sourcepub async fn get_or_create_current(
pool: &Pool<Postgres>,
hosted_mock_id: Uuid,
) -> Result<DeploymentMetrics, Error>
pub async fn get_or_create_current( pool: &Pool<Postgres>, hosted_mock_id: Uuid, ) -> Result<DeploymentMetrics, Error>
Get or create metrics for current period
Trait Implementations§
Source§impl Clone for DeploymentMetrics
impl Clone for DeploymentMetrics
Source§fn clone(&self) -> DeploymentMetrics
fn clone(&self) -> DeploymentMetrics
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 DeploymentMetrics
impl Debug for DeploymentMetrics
Source§impl<'de> Deserialize<'de> for DeploymentMetrics
impl<'de> Deserialize<'de> for DeploymentMetrics
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeploymentMetrics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DeploymentMetrics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DeploymentMetrics> for MetricsResponse
impl From<DeploymentMetrics> for MetricsResponse
Source§fn from(metrics: DeploymentMetrics) -> Self
fn from(metrics: DeploymentMetrics) -> Self
Converts to this type from the input type.
Source§impl<'a, R> FromRow<'a, R> for DeploymentMetricswhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
NaiveDate: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i64: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for DeploymentMetricswhere
R: Row,
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
NaiveDate: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i64: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Source§impl Serialize for DeploymentMetrics
impl Serialize for DeploymentMetrics
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DeploymentMetrics
impl RefUnwindSafe for DeploymentMetrics
impl Send for DeploymentMetrics
impl Sync for DeploymentMetrics
impl Unpin for DeploymentMetrics
impl UnsafeUnpin for DeploymentMetrics
impl UnwindSafe for DeploymentMetrics
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 moreCreates a shared type from an unshared type.