Skip to main content

DroppedRecordStats

Struct DroppedRecordStats 

Source
#[repr(C)]
pub struct DroppedRecordStats { pub first_dropped: zx_instant_boot_ticks_t, pub last_dropped: zx_instant_boot_ticks_t, pub num_dropped: u32, pub bytes_dropped: u32, pub has_dropped: bool, pub __bindgen_padding_0: [u8; 7], }
Expand description

This struct keeps track of the duration, number, and size of trace records dropped when the buffer is full. These statistics are emitted to the trace buffer as a duration as soon as space is available to do so, at which point the values are reset to 0, or false in the case of has_dropped.

Fields§

§first_dropped: zx_instant_boot_ticks_t§last_dropped: zx_instant_boot_ticks_t§num_dropped: u32

By storing num_dropped and bytes_dropped in 32-bit values, we ensure that they can each be stored in a single 64-bit word in the FXT record we emit when space is available.

§bytes_dropped: u32§has_dropped: bool§__bindgen_padding_0: [u8; 7]

Implementations§

Source§

impl DroppedRecordStats

Source

pub const fn new() -> Self

Creates a zero-initialized DroppedRecordStats.

Source

pub fn reset(&mut self)

Resets the dropped record statistics to their initial values.

Source

pub fn track(&mut self, now: zx_instant_boot_ticks_t, size: u32)

Records a dropped trace record of size bytes at timestamp now.

Source

pub const fn has_dropped(&self) -> bool

Returns true if any records have been dropped since the last reset.

Trait Implementations§

Source§

impl Default for DroppedRecordStats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.