pub enum MetricCategory {
Rows,
Bytes,
Timing,
Uncategorized,
}Expand description
Classifies a metric by what it measures.
This is orthogonal to MetricType (Summary / Dev), which controls
verbosity. MetricCategory controls what kind of value is shown,
so that EXPLAIN ANALYZE output can be narrowed to only the categories
that are useful in a given context.
In particular this is useful for testing since metrics differ in their stability across runs:
RowsandBytesdepend only on the plan and the data, so they are mostly deterministic across runs (given the same input). Variations can existing e.g. because of non-deterministic ordering of evaluation between threads. Running with a single target partition often makes these metrics stable enough to assert on in tests.Timingdepends on hardware, system load, scheduling, etc., so it varies from run to run even on the same machine.
MetricCategory is especially useful in sqllogictest (.slt) files:
setting datafusion.explain.analyze_categories = 'rows' lets a test
assert on row-count metrics without sprinkling <slt:ignore> over every
timing value.
Metrics that do not declare a category (the default for custom
Count / Gauge metrics) are treated as
Uncategorized for filtering purposes.
Variants§
Rows
Row counts and related dimensionless counters: output_rows,
spilled_rows, output_batches, pruning metrics, ratios, etc.
Mostly deterministic given the same plan and data.
Bytes
Byte measurements: output_bytes, spilled_bytes,
current_memory_usage, bytes_scanned, etc.
Mostly deterministic given the same plan and data.
Timing
Wall-clock durations and timestamps: elapsed_compute,
operator-defined Time metrics, start_timestamp /
end_timestamp, etc.
Non-deterministic — varies across runs even on the same hardware.
Uncategorized
Catch-all for metrics that do not fit into Rows,
Bytes, or Timing.
Custom Count / Gauge metrics that are not explicitly assigned
a category are treated as Uncategorized for filtering purposes.
This variant lets users explicitly include or exclude these metrics, e.g.:
SET datafusion.explain.analyze_categories = 'rows, bytes, uncategorized';Trait Implementations§
Source§impl Clone for MetricCategory
impl Clone for MetricCategory
Source§fn clone(&self) -> MetricCategory
fn clone(&self) -> MetricCategory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MetricCategory
Source§impl Debug for MetricCategory
impl Debug for MetricCategory
Source§impl Display for MetricCategory
impl Display for MetricCategory
impl Eq for MetricCategory
Source§impl FromStr for MetricCategory
impl FromStr for MetricCategory
Source§impl Hash for MetricCategory
impl Hash for MetricCategory
Source§impl PartialEq for MetricCategory
impl PartialEq for MetricCategory
Source§fn eq(&self, other: &MetricCategory) -> bool
fn eq(&self, other: &MetricCategory) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MetricCategory
Auto Trait Implementations§
impl Freeze for MetricCategory
impl RefUnwindSafe for MetricCategory
impl Send for MetricCategory
impl Sync for MetricCategory
impl Unpin for MetricCategory
impl UnsafeUnpin for MetricCategory
impl UnwindSafe for MetricCategory
Blanket Implementations§
impl<T> Allocation for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.