pub enum StatsRequest {
GetMemoryStats {
responder: StatsGetMemoryStatsResponder,
},
GetMemoryStatsExtended {
responder: StatsGetMemoryStatsExtendedResponder,
},
GetMemoryStatsCompression {
responder: StatsGetMemoryStatsCompressionResponder,
},
GetCpuStats {
responder: StatsGetCpuStatsResponder,
},
GetCpuLoad {
duration: i64,
responder: StatsGetCpuLoadResponder,
},
}
Expand description
Protocol for providing kernel stats. This is roughly a wrapper around zx_object_get_info for the ZX_INFO_KMEM_STATS and ZX_INFO_CPU_STATS topics, which today require the very powerful ‘Root Resource’ capability to obtain. Instead of vending out that capability, programs that just want stats should use this service instead. If for some reason the protocol fails to retrieve stats, which will be an un-recoverable error, it will close the channel.
Variants§
GetMemoryStats
Fields
§
responder: StatsGetMemoryStatsResponder
GetMemoryStatsExtended
Fields
§
responder: StatsGetMemoryStatsExtendedResponder
GetMemoryStatsCompression
Fields
§
responder: StatsGetMemoryStatsCompressionResponder
GetCpuStats
Fields
§
responder: StatsGetCpuStatsResponder
GetCpuLoad
Gets the average load as a percentage (0.0 - 100.0) from each CPU over the specified duration.
Load is calculated as (100 - %idle), where %idle is the percentage value of idle_time (from PerCpuStats) over a time duration.
Implementations§
Source§impl StatsRequest
impl StatsRequest
pub fn into_get_memory_stats(self) -> Option<StatsGetMemoryStatsResponder>
pub fn into_get_memory_stats_extended( self, ) -> Option<StatsGetMemoryStatsExtendedResponder>
pub fn into_get_memory_stats_compression( self, ) -> Option<StatsGetMemoryStatsCompressionResponder>
pub fn into_get_cpu_stats(self) -> Option<StatsGetCpuStatsResponder>
pub fn into_get_cpu_load(self) -> Option<(i64, StatsGetCpuLoadResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StatsRequest
impl !RefUnwindSafe for StatsRequest
impl Send for StatsRequest
impl Sync for StatsRequest
impl Unpin for StatsRequest
impl !UnwindSafe for StatsRequest
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