pub enum MetricValue {
Show 15 variants
OutputRows(Count),
ElapsedCompute(Time),
SpillCount(Count),
SpilledBytes(Count),
OutputBytes(Count),
SpilledRows(Count),
CurrentMemoryUsage(Gauge),
Count {
name: Cow<'static, str>,
count: Count,
},
Gauge {
name: Cow<'static, str>,
gauge: Gauge,
},
Time {
name: Cow<'static, str>,
time: Time,
},
StartTimestamp(Timestamp),
EndTimestamp(Timestamp),
PruningMetrics {
name: Cow<'static, str>,
pruning_metrics: PruningMetrics,
},
Ratio {
name: Cow<'static, str>,
ratio_metrics: RatioMetrics,
},
Custom {
name: Cow<'static, str>,
value: Arc<dyn CustomMetricValue>,
},
}Expand description
Possible values for a super::Metric.
Among other differences, the metric types have different ways to logically interpret their underlying values and some metrics are so common they are given special treatment.
Variants§
OutputRows(Count)
Number of output rows produced: “output_rows” metric
ElapsedCompute(Time)
Elapsed Compute Time: the wall clock time spent in “cpu intensive” work.
This measurement represents, roughly:
use std::time::Instant;
let start = Instant::now();
// ...CPU intensive work here...
let elapsed_compute = (Instant::now() - start).as_nanos();Note 1: Does not include time other operators spend computing input.
Note 2: Does includes time when the thread could have made
progress but the OS did not schedule it (e.g. due to CPU
contention), thus making this value different than the
classical definition of “cpu_time”, which is the time reported
from clock_gettime(CLOCK_THREAD_CPUTIME_ID, ..).
SpillCount(Count)
Number of spills produced: “spill_count” metric
SpilledBytes(Count)
Total size of spilled bytes produced: “spilled_bytes” metric
OutputBytes(Count)
Total size of output bytes produced: “output_bytes” metric
SpilledRows(Count)
Total size of spilled rows produced: “spilled_rows” metric
CurrentMemoryUsage(Gauge)
Current memory used
Count
Operator defined count.
Gauge
Operator defined gauge.
Time
Operator defined time
StartTimestamp(Timestamp)
The time at which execution started
EndTimestamp(Timestamp)
The time at which execution ended
PruningMetrics
Metrics related to scan pruning
Ratio
Metrics that should be displayed as ratio like (42%)
Custom
Implementations§
Source§impl MetricValue
impl MetricValue
Sourcepub fn as_usize(&self) -> usize
pub fn as_usize(&self) -> usize
Return the value of the metric as a usize value, used to aggregate metric value across partitions.
Sourcepub fn new_empty(&self) -> Self
pub fn new_empty(&self) -> Self
create a new MetricValue with the same type as self suitable
for accumulating
Sourcepub fn aggregate(&mut self, other: &Self)
pub fn aggregate(&mut self, other: &Self)
Aggregates the value of other to self. panic’s if the types
are mismatched or aggregating does not make sense for this
value
Note this is purposely marked mut (even though atomics are
used) so Rust’s type system can be used to ensure the
appropriate API access. MetricValues should be modified
using the original Count or Time they were created
from.
Sourcepub fn display_sort_key(&self) -> u8
pub fn display_sort_key(&self) -> u8
Returns a number by which to sort metrics by display. Lower numbers are “more useful” (and displayed first)
Sourcepub fn is_timestamp(&self) -> bool
pub fn is_timestamp(&self) -> bool
returns true if this metric has a timestamp value
Trait Implementations§
Source§impl Clone for MetricValue
impl Clone for MetricValue
Source§fn clone(&self) -> MetricValue
fn clone(&self) -> MetricValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetricValue
impl Debug for MetricValue
Source§impl Display for MetricValue
impl Display for MetricValue
Source§impl PartialEq for MetricValue
impl PartialEq for MetricValue
Auto Trait Implementations§
impl Freeze for MetricValue
impl !RefUnwindSafe for MetricValue
impl Send for MetricValue
impl Sync for MetricValue
impl Unpin for MetricValue
impl !UnwindSafe for MetricValue
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> 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