Struct ArgRate

Source
pub struct ArgRate {
    pub uptime: f64,
    pub cycle: f64,
    pub cycle_usage: f64,
    pub interval: f64,
    pub load: f64,
    pub err: usize,
    pub remains: usize,
    pub rate_low: f64,
    pub anchor_low: f64,
    pub anchor: f64,
    pub stamps: Vec<f64>,
}
Expand description

some infomation about dyer at rumtime where speed and error-handler based on

Fields§

§uptime: f64

all time the app runs

§cycle: f64

the time that a cycle lasts, backup application history once running out

§cycle_usage: f64

time the app runs in each cycle

§interval: f64

a time gap when updating some infomation

§load: f64

normally the speed that the app spawns tasks in the whole interval

§err: usize

failed tasks in each interval

§remains: usize

remaining jobs to do in each cycle in each interval

§rate_low: f64

the rate applied to limit the requests to be spawned in low mode

§anchor_low: f64

time anchor by which the mode is low

§anchor: f64

time anchor at which update some infomation

§stamps: Vec<f64>

vector of gap each request takes to receive response header in each interval

Implementations§

Source§

impl ArgRate

Source

pub fn new() -> Self

Source

pub fn update(&mut self) -> bool

Source

pub fn backup(&mut self) -> bool

backup the Task Affix Request for some time in case of interupt

Source

pub fn get_len(&mut self, tm: Option<f64>) -> usize

decide the length of Task to be spawned

Trait Implementations§

Source§

impl Debug for ArgRate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more