pub struct StatsHistoryBucket {
pub time: DateTime<Utc>,
pub completed: u64,
pub failed: u64,
pub cancelled: u64,
pub avg_duration_ms: u64,
pub p95_duration_ms: u64,
pub total_cost_usd: Decimal,
}Expand description
One time bucket of aggregated run statistics.
Each bucket covers a time range determined by the granularity (1 hour, 1 day, or 1 week).
§Examples
use chrono::Utc;
use rust_decimal::Decimal;
use ironflow_store::entities::StatsHistoryBucket;
let bucket = StatsHistoryBucket {
time: Utc::now(),
completed: 42,
failed: 3,
cancelled: 1,
avg_duration_ms: 45000,
p95_duration_ms: 120000,
total_cost_usd: Decimal::new(123, 2),
};
assert_eq!(bucket.completed, 42);Fields§
§time: DateTime<Utc>Start of the time bucket.
completed: u64Number of runs that completed in this bucket.
failed: u64Number of runs that failed in this bucket.
cancelled: u64Number of runs that were cancelled in this bucket.
avg_duration_ms: u64Average duration in milliseconds of terminal runs in this bucket.
p95_duration_ms: u6495th percentile duration in milliseconds of terminal runs in this bucket.
total_cost_usd: DecimalTotal cost in USD of all runs in this bucket.
Trait Implementations§
Source§impl Clone for StatsHistoryBucket
impl Clone for StatsHistoryBucket
Source§fn clone(&self) -> StatsHistoryBucket
fn clone(&self) -> StatsHistoryBucket
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 StatsHistoryBucket
impl Debug for StatsHistoryBucket
Source§impl<'de> Deserialize<'de> for StatsHistoryBucket
impl<'de> Deserialize<'de> for StatsHistoryBucket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StatsHistoryBucket
impl RefUnwindSafe for StatsHistoryBucket
impl Send for StatsHistoryBucket
impl Sync for StatsHistoryBucket
impl Unpin for StatsHistoryBucket
impl UnsafeUnpin for StatsHistoryBucket
impl UnwindSafe for StatsHistoryBucket
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