pub struct GroupingConfig {
pub columns: Vec<String>,
pub max_groups: Option<usize>,
pub include_overall: bool,
pub overflow_strategy: OverflowStrategy,
}Expand description
Configuration for grouped metric analysis.
Fields§
§columns: Vec<String>Columns to group by.
max_groups: Option<usize>Maximum number of groups to track (for memory management).
include_overall: boolWhether to include overall (ungrouped) metric.
overflow_strategy: OverflowStrategyStrategy for handling high-cardinality groups.
Implementations§
Source§impl GroupingConfig
impl GroupingConfig
Sourcepub fn new(columns: Vec<String>) -> Self
pub fn new(columns: Vec<String>) -> Self
Creates a new grouping configuration with default settings.
Sourcepub fn with_max_groups(self, max: usize) -> Self
pub fn with_max_groups(self, max: usize) -> Self
Sets the maximum number of groups to track.
Sourcepub fn with_overall(self, include: bool) -> Self
pub fn with_overall(self, include: bool) -> Self
Sets whether to include the overall metric.
Sourcepub fn with_overflow_strategy(self, strategy: OverflowStrategy) -> Self
pub fn with_overflow_strategy(self, strategy: OverflowStrategy) -> Self
Sets the overflow strategy for high-cardinality groups.
Sourcepub fn group_by_sql(&self) -> String
pub fn group_by_sql(&self) -> String
Returns SQL column list for GROUP BY clause.
Sourcepub fn select_group_columns_sql(&self) -> String
pub fn select_group_columns_sql(&self) -> String
Returns SQL column selection for grouping columns.
Trait Implementations§
Source§impl Clone for GroupingConfig
impl Clone for GroupingConfig
Source§fn clone(&self) -> GroupingConfig
fn clone(&self) -> GroupingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GroupingConfig
impl Debug for GroupingConfig
Source§impl<'de> Deserialize<'de> for GroupingConfig
impl<'de> Deserialize<'de> for GroupingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GroupingConfig
impl RefUnwindSafe for GroupingConfig
impl Send for GroupingConfig
impl Sync for GroupingConfig
impl Unpin for GroupingConfig
impl UnwindSafe for GroupingConfig
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
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>
Converts
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>
Converts
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