Struct diagnostics_reader::ArchiveReader
source · pub struct ArchiveReader { /* private fields */ }
Expand description
Utility for reading inspect data of a running component using the injected Archive Reader service.
Implementations§
source§impl ArchiveReader
impl ArchiveReader
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new data fetcher with default configuration:
- Maximum retries: 2^64-1
- Timeout: Never. Use with_timeout() to set a timeout.
pub fn with_archive(&mut self, archive: ArchiveAccessorProxy) -> &mut Self
sourcepub fn add_selector(&mut self, selector: impl ToSelectorArguments) -> &mut Self
pub fn add_selector(&mut self, selector: impl ToSelectorArguments) -> &mut Self
Requests a single component tree (or sub-tree).
sourcepub fn select_all_for_moniker(&mut self, moniker: &str) -> &mut Self
pub fn select_all_for_moniker(&mut self, moniker: &str) -> &mut Self
Requests all data for the component identified by the given moniker.
sourcepub fn retry(&mut self, config: RetryConfig) -> &mut Self
pub fn retry(&mut self, config: RetryConfig) -> &mut Self
Sets a custom retry configuration. By default we always retry.
pub fn add_selectors<T, S>(&mut self, selectors: T) -> &mut Selfwhere
T: Iterator<Item = S>,
S: ToSelectorArguments,
sourcepub fn with_timeout(&mut self, duration: Duration) -> &mut Self
pub fn with_timeout(&mut self, duration: Duration) -> &mut Self
Sets the maximum time to wait for a response from the Archive. Do not use in tests unless timeout is the expected behavior.
pub fn with_aggregated_result_bytes_limit( &mut self, limit_bytes: u64 ) -> &mut Self
sourcepub fn with_batch_retrieval_timeout_seconds(
&mut self,
timeout: i64
) -> &mut Self
pub fn with_batch_retrieval_timeout_seconds( &mut self, timeout: i64 ) -> &mut Self
Set the maximum time to wait for a wait for a single component to have its diagnostics data “pumped”.
sourcepub fn with_minimum_schema_count(
&mut self,
minimum_schema_count: usize
) -> &mut Self
pub fn with_minimum_schema_count( &mut self, minimum_schema_count: usize ) -> &mut Self
Sets the minumum number of schemas expected in a result in order for the result to be considered a success.
sourcepub async fn snapshot<D>(&self) -> Result<Vec<Data<D>>, Error>where
D: DiagnosticsData,
pub async fn snapshot<D>(&self) -> Result<Vec<Data<D>>, Error>where
D: DiagnosticsData,
Connects to the ArchiveAccessor and returns data matching provided selectors.
sourcepub fn snapshot_then_subscribe<D>(&self) -> Result<Subscription<Data<D>>, Error>where
D: DiagnosticsData + 'static,
pub fn snapshot_then_subscribe<D>(&self) -> Result<Subscription<Data<D>>, Error>where
D: DiagnosticsData + 'static,
Connects to the ArchiveAccessor and returns a stream of data containing a snapshot of the current buffer in the Archivist as well as new data that arrives.
sourcepub async fn snapshot_raw<D, T>(&self) -> Result<T, Error>where
D: DiagnosticsData,
T: for<'a> Deserialize<'a> + SerializableValue + From<Vec<T>> + CheckResponse,
pub async fn snapshot_raw<D, T>(&self) -> Result<T, Error>where
D: DiagnosticsData,
T: for<'a> Deserialize<'a> + SerializableValue + From<Vec<T>> + CheckResponse,
Connects to the ArchiveAccessor and returns inspect data matching provided selectors. Returns the raw json for each hierarchy fetched.
sourcepub fn snapshot_then_subscribe_raw<D, T>(
&self
) -> Result<Subscription<T>, Error>where
D: DiagnosticsData + 'static,
T: for<'a> Deserialize<'a> + Send + SerializableValue + 'static,
pub fn snapshot_then_subscribe_raw<D, T>(
&self
) -> Result<Subscription<T>, Error>where
D: DiagnosticsData + 'static,
T: for<'a> Deserialize<'a> + Send + SerializableValue + 'static,
Connects to the ArchiveAccessor and returns a stream of data containing a snapshot of the current buffer in the Archivist as well as new data that arrives.
Trait Implementations§
source§impl Clone for ArchiveReader
impl Clone for ArchiveReader
source§fn clone(&self) -> ArchiveReader
fn clone(&self) -> ArchiveReader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more