pub struct GovernorFacts {
pub rate: f64,
pub set_rate: f64,
pub escalation: Option<EscalationFacts>,
pub frames_today: u64,
pub frames_limit: u64,
pub renews_at: DateTime<Utc>,
pub look_less_at: f64,
pub stop_asking_at: f64,
pub min_rate: Option<f64>,
pub steps: Vec<GovernorStep>,
}Expand description
The frame governor’s state for one camera (spec 3.7 §7.9, board choice C3): how often it looks, whether it asks a cloud model about unclear tracks, and today’s frames.
Fields§
§rate: f64Frames looked at a second now.
set_rate: f64Frames a second as set.
escalation: Option<EscalationFacts>Escalation of unclear tracks, when this camera escalates.
frames_today: u64Frames looked at today.
frames_limit: u64The daily frame limit.
renews_at: DateTime<Utc>When the budget renews.
look_less_at: f64The share of the limit at which the governor looks less often.
stop_asking_at: f64The share at which it stops escalating.
min_rate: Option<f64>The lowest rate the governor looks at before it stops escalating and pauses, when it
steps by whether the frames left can last rather than at fixed shares (spec 3.7 §7.9’s
FrameGovernor).
steps: Vec<GovernorStep>Today’s steps, oldest first.
Implementations§
Source§impl GovernorFacts
impl GovernorFacts
Sourcepub fn new(rate: f64, frames_limit: u64, renews_at: DateTime<Utc>) -> Self
pub fn new(rate: f64, frames_limit: u64, renews_at: DateTime<Utc>) -> Self
Looking rate times a second, as set, against frames_limit frames a day renewing at
renews_at, with the steps at 90% and 95%.
Sourcepub fn with_escalation(self, escalation: EscalationFacts) -> Self
pub fn with_escalation(self, escalation: EscalationFacts) -> Self
Escalation of unclear tracks.
Sourcepub fn with_frames_today(self, frames: u64) -> Self
pub fn with_frames_today(self, frames: u64) -> Self
Frames looked at today.
Sourcepub fn with_step(self, step: GovernorStep) -> Self
pub fn with_step(self, step: GovernorStep) -> Self
A step the governor took.
Sourcepub fn stepped_down(&self) -> bool
pub fn stepped_down(&self) -> bool
Whether the governor stepped down today and has not paused.
Trait Implementations§
Source§impl Clone for GovernorFacts
impl Clone for GovernorFacts
Source§impl Debug for GovernorFacts
impl Debug for GovernorFacts
Source§impl<'de> Deserialize<'de> for GovernorFacts
impl<'de> Deserialize<'de> for GovernorFacts
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>,
Source§impl PartialEq for GovernorFacts
impl PartialEq for GovernorFacts
Source§impl Serialize for GovernorFacts
impl Serialize for GovernorFacts
impl StructuralPartialEq for GovernorFacts
Auto Trait Implementations§
impl Forget for GovernorFacts
impl Freeze for GovernorFactswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
NonZero<i32>: Freeze,
Utc: Freeze,
PhantomData<GovernorStep>: Freeze,
impl Move for GovernorFacts
impl RefUnwindSafe for GovernorFacts
impl Send for GovernorFacts
impl Sync for GovernorFacts
impl Unpin for GovernorFacts
impl UnsafeUnpin for GovernorFactswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
NonZeroI32Inner: UnsafeUnpin,
Utc: UnsafeUnpin,
PhantomData<GovernorStep>: UnsafeUnpin,
impl UnwindSafe for GovernorFacts
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> 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<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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 more