pub struct ProcessQueryBuilder { /* private fields */ }Expand description
Builder for creating process queries with various filters.
This builder allows you to construct queries to find processes based on various criteria like process ID, username, executable name, time ranges, and whether they contain CPU blocks or specific thread names.
Implementations§
Source§impl ProcessQueryBuilder
impl ProcessQueryBuilder
Sourcepub fn with_process_id(self, process_id: &str) -> Self
pub fn with_process_id(self, process_id: &str) -> Self
Filters processes by exact process ID.
Sourcepub fn with_username(self, username: &str) -> Self
pub fn with_username(self, username: &str) -> Self
Filters processes by exact username.
Sourcepub fn since(self, begin: DateTime<Utc>) -> Self
pub fn since(self, begin: DateTime<Utc>) -> Self
Filters processes that ended at or after the given time.
Sourcepub fn until(self, end: DateTime<Utc>) -> Self
pub fn until(self, end: DateTime<Utc>) -> Self
Filters processes that began at or before the given time.
Sourcepub fn with_cpu_blocks(self) -> Self
pub fn with_cpu_blocks(self) -> Self
Filters processes that have CPU blocks (contain telemetry streams tagged with ‘cpu’).
Sourcepub fn with_thread_named(self, thread_name: &str) -> Self
pub fn with_thread_named(self, thread_name: &str) -> Self
Filters processes that have a thread with the specified name.
Sourcepub fn into_where(&self) -> String
pub fn into_where(&self) -> String
Converts the filters into a SQL WHERE clause.
Sourcepub async fn query(self, client: &mut Client) -> Result<Vec<RecordBatch>>
pub async fn query(self, client: &mut Client) -> Result<Vec<RecordBatch>>
Executes the query and returns the matching processes.
Returns a vector of RecordBatch containing process information including:
- process_id
- begin/end times
- exe (executable name)
- properties
- computer
- username
- cpu_brand
- distro
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessQueryBuilder
impl RefUnwindSafe for ProcessQueryBuilder
impl Send for ProcessQueryBuilder
impl Sync for ProcessQueryBuilder
impl Unpin for ProcessQueryBuilder
impl UnwindSafe for ProcessQueryBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].