pub struct StreamConfig {
pub enabled_streams: HashSet<StreamType>,
pub event_types: Option<HashSet<String>>,
pub event_types_exclude: Option<HashSet<String>>,
pub event_levels: Option<HashSet<String>>,
pub metric_names: Option<HashSet<String>>,
pub metric_phases: Option<HashSet<String>>,
pub timeline_phases: Option<HashSet<String>>,
pub sample_rate: f64,
pub max_events_per_poll: Option<usize>,
pub deduplicate: bool,
pub poll_interval_seconds: f64,
}Expand description
Configuration for stream filtering and behavior.
Fields§
§enabled_streams: HashSet<StreamType>Which stream types to enable.
event_types: Option<HashSet<String>>Whitelist of event types to include (None = include all).
event_types_exclude: Option<HashSet<String>>Blacklist of event types to exclude.
event_levels: Option<HashSet<String>>Filter by event levels (e.g., “error”, “warning”, “info”).
metric_names: Option<HashSet<String>>Filter metrics by name.
metric_phases: Option<HashSet<String>>Filter metrics by phase.
timeline_phases: Option<HashSet<String>>Filter timeline entries by phase.
sample_rate: f64Sampling rate (0.0-1.0) for events.
max_events_per_poll: Option<usize>Maximum events to return per poll.
deduplicate: boolEnable deduplication.
poll_interval_seconds: f64Polling interval in seconds.
Implementations§
Source§impl StreamConfig
impl StreamConfig
Sourcepub fn all() -> StreamConfig
pub fn all() -> StreamConfig
Create a config that includes all streams with no filtering.
Sourcepub fn with_default_filters() -> StreamConfig
pub fn with_default_filters() -> StreamConfig
Create a config with sensible default filters.
Sourcepub fn minimal() -> StreamConfig
pub fn minimal() -> StreamConfig
Create a minimal config (status only).
Sourcepub fn errors_only() -> StreamConfig
pub fn errors_only() -> StreamConfig
Create a config for errors and warnings only.
Sourcepub fn metrics_only() -> StreamConfig
pub fn metrics_only() -> StreamConfig
Create a config for metrics only.
Sourcepub fn enable_stream(self, stream_type: StreamType) -> StreamConfig
pub fn enable_stream(self, stream_type: StreamType) -> StreamConfig
Enable a specific stream type.
Sourcepub fn disable_stream(self, stream_type: StreamType) -> StreamConfig
pub fn disable_stream(self, stream_type: StreamType) -> StreamConfig
Disable a specific stream type.
Sourcepub fn include_event_type(self, event_type: impl Into<String>) -> StreamConfig
pub fn include_event_type(self, event_type: impl Into<String>) -> StreamConfig
Add an event type to the whitelist.
Sourcepub fn exclude_event_type(self, event_type: impl Into<String>) -> StreamConfig
pub fn exclude_event_type(self, event_type: impl Into<String>) -> StreamConfig
Add an event type to the blacklist.
Sourcepub fn with_levels(self, levels: Vec<&str>) -> StreamConfig
pub fn with_levels(self, levels: Vec<&str>) -> StreamConfig
Filter by event levels.
Sourcepub fn with_metric_phases(self, phases: Vec<&str>) -> StreamConfig
pub fn with_metric_phases(self, phases: Vec<&str>) -> StreamConfig
Filter metrics by phase.
Sourcepub fn with_timeline_phases(self, phases: Vec<&str>) -> StreamConfig
pub fn with_timeline_phases(self, phases: Vec<&str>) -> StreamConfig
Filter timeline entries by phase.
Sourcepub fn with_interval(self, seconds: f64) -> StreamConfig
pub fn with_interval(self, seconds: f64) -> StreamConfig
Set the polling interval.
Sourcepub fn with_sample_rate(self, rate: f64) -> StreamConfig
pub fn with_sample_rate(self, rate: f64) -> StreamConfig
Set the sample rate.
Sourcepub fn without_deduplication(self) -> StreamConfig
pub fn without_deduplication(self) -> StreamConfig
Disable deduplication.
Sourcepub fn is_stream_enabled(&self, stream_type: StreamType) -> bool
pub fn is_stream_enabled(&self, stream_type: StreamType) -> bool
Check if a stream type is enabled.
Sourcepub fn should_include_event(&self, event: &Value) -> bool
pub fn should_include_event(&self, event: &Value) -> bool
Check if an event should be included based on filters.
Sourcepub fn should_include_metric(&self, metric: &Value) -> bool
pub fn should_include_metric(&self, metric: &Value) -> bool
Check if a metric should be included based on filters.
Sourcepub fn should_include_timeline(&self, entry: &Value) -> bool
pub fn should_include_timeline(&self, entry: &Value) -> bool
Check if a timeline entry should be included based on filters.
Trait Implementations§
Source§impl Clone for StreamConfig
impl Clone for StreamConfig
Source§fn clone(&self) -> StreamConfig
fn clone(&self) -> StreamConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamConfig
impl Debug for StreamConfig
Source§impl Default for StreamConfig
impl Default for StreamConfig
Source§fn default() -> StreamConfig
fn default() -> StreamConfig
Auto Trait Implementations§
impl Freeze for StreamConfig
impl RefUnwindSafe for StreamConfig
impl Send for StreamConfig
impl Sync for StreamConfig
impl Unpin for StreamConfig
impl UnwindSafe for StreamConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request