pub enum MetricValue {
OutputRows(Count),
ElapsedCompute(Time),
SpillCount(Count),
SpilledBytes(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),
}
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
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
Implementations§
Source§impl MetricValue
impl MetricValue
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
impl StructuralPartialEq 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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