pub struct SysmontapService<S> { /* private fields */ }Expand description
Connect and start a sysmontap CPU monitoring session.
Returns an async stream of CpuSample values.
Implementations§
Source§impl<S: AsyncRead + AsyncWrite + Unpin + Send> SysmontapService<S>
impl<S: AsyncRead + AsyncWrite + Unpin + Send> SysmontapService<S>
Sourcepub async fn start(
stream: S,
config: &SysmontapConfig,
sys_attrs: Option<Vec<Value>>,
proc_attrs: Option<Vec<Value>>,
) -> Result<Self, DtxError>
pub async fn start( stream: S, config: &SysmontapConfig, sys_attrs: Option<Vec<Value>>, proc_attrs: Option<Vec<Value>>, ) -> Result<Self, DtxError>
Initialize sysmontap on an already-connected instruments stream.
sys_attrs and proc_attrs are optional attribute lists from the deviceinfo service.
Pass None to use defaults (works on iOS 17+; older iOS may need them).
Sourcepub async fn next_cpu_sample(&mut self) -> Result<Option<CpuSample>, DtxError>
pub async fn next_cpu_sample(&mut self) -> Result<Option<CpuSample>, DtxError>
Receive the next CPU sample from the device. Blocks until a sample arrives.
Sourcepub async fn next_process_snapshot(
&mut self,
proc_attr_names: &[String],
) -> Result<Option<ProcessSample>, DtxError>
pub async fn next_process_snapshot( &mut self, proc_attr_names: &[String], ) -> Result<Option<ProcessSample>, DtxError>
Receive the next per-process snapshot from sysmontap.
proc_attr_names should be the ordered list of attribute names matching
the procAttrs config (e.g. from DeviceInfoClient::process_attributes()).
Each process’s values array is zipped with these names.
Auto Trait Implementations§
impl<S> Freeze for SysmontapService<S>where
S: Freeze,
impl<S> RefUnwindSafe for SysmontapService<S>where
S: RefUnwindSafe,
impl<S> Send for SysmontapService<S>where
S: Send,
impl<S> Sync for SysmontapService<S>where
S: Sync,
impl<S> Unpin for SysmontapService<S>where
S: Unpin,
impl<S> UnsafeUnpin for SysmontapService<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for SysmontapService<S>where
S: UnwindSafe,
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