pub struct StatVariable {
pub total: u64,
pub count_since_last_stat: u64,
pub last_stat_at: Timestamp,
pub bins: VecDeque<(u64, Timestamp)>,
pub avg: f64,
pub max_avg: f64,
pub min_avg: f64,
pub name: String,
pub sender: Sender<String>,
}
Fields§
§total: u64
§count_since_last_stat: u64
§last_stat_at: Timestamp
§bins: VecDeque<(u64, Timestamp)>
§avg: f64
§max_avg: f64
§min_avg: f64
§name: String
§sender: Sender<String>
Implementations§
Source§impl StatVariable
impl StatVariable
pub fn new( name: String, bin_count: usize, sender: Sender<String>, ) -> StatVariable
pub fn increment(&mut self)
pub fn increment_by(&mut self, amount: u64)
pub async fn calculate_stats(&mut self, current_time_in_ms: Timestamp)
pub fn format_timestamp(timestamp: Timestamp) -> String
Trait Implementations§
Source§impl Clone for StatVariable
impl Clone for StatVariable
Source§fn clone(&self) -> StatVariable
fn clone(&self) -> StatVariable
Returns a copy of the value. Read more
1.0.0 · 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 Freeze for StatVariable
impl !RefUnwindSafe for StatVariable
impl Send for StatVariable
impl Sync for StatVariable
impl Unpin for StatVariable
impl !UnwindSafe for StatVariable
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