pub struct CrashThrottler {
pub crash_loop_age_out: MonotonicDuration,
/* private fields */
}Expand description
Decides whether to throttle crashes for a given process based on how frequently they are occurring. Records information about throttled crashes for diagnostics.
Fields§
§crash_loop_age_out: MonotonicDurationThe period before a crash is no longer considered for detecting crash loops.
Implementations§
Source§impl CrashThrottler
impl CrashThrottler
pub fn new( inspect_node: &Node, crash_loop_age_out: MonotonicDuration, enable_throttling: bool, ) -> Self
Sourcepub fn should_report(
&self,
argv: Vec<String>,
argv0: String,
runtime: MonotonicInstant,
) -> Option<PendingCrashReport>
pub fn should_report( &self, argv: Vec<String>, argv0: String, runtime: MonotonicInstant, ) -> Option<PendingCrashReport>
Locally records that a crash for process_name occurred at runtime and returns a guard
for an in-flight report if few enough overall are in-flight, as well as the weight that
should be assigned to the crash report.
Note: runtime is the total time the device has been on according to the monotonic clock, not the amount of time the process was running.
Auto Trait Implementations§
impl Freeze for CrashThrottler
impl !RefUnwindSafe for CrashThrottler
impl Send for CrashThrottler
impl Sync for CrashThrottler
impl Unpin for CrashThrottler
impl !UnwindSafe for CrashThrottler
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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 more