Struct elasticsearch_dsl::search::aggregations::metrics::RateAggregation
source · [−]pub struct RateAggregation { /* private fields */ }
Expand description
A rate
metrics aggregation can be used only inside a date_histogram
and calculates a rate of
documents or a field in each date_histogram
bucket. The field values can be generated extracted
from specific numeric or histogram fields
in the documents.
Implementations
sourceimpl RateAggregation
impl RateAggregation
sourcepub fn field(self, field: impl Into<String>) -> Self
pub fn field(self, field: impl Into<String>) -> Self
Calculate sum or number of values of the field
sourcepub fn unit(self, unit: impl Into<CalendarInterval>) -> Self
pub fn unit(self, unit: impl Into<CalendarInterval>) -> Self
The rate
aggregation supports all rate that can be used calendar_intervals parameter
of date_histogram
aggregation. The specified rate should compatible with the date_histogram
aggregation interval, i.e. it should be possible to convert the bucket size into the rate.
By default the interval of the date_histogram
is used.
There is also an additional limitations if the date histogram is not a direct parent of the
rate histogram. In this case both rate interval and histogram interval have to be in the
same group: [second, minute
, hour, day, week] or [month, quarter, year]. For example,
if the date histogram is month based, only rate intervals of month, quarter or year are
supported. If the date histogram is day
based, only second
, minute
, hour
, day, and
week` rate intervals are supported.
Trait Implementations
sourceimpl Clone for RateAggregation
impl Clone for RateAggregation
sourcefn clone(&self) -> RateAggregation
fn clone(&self) -> RateAggregation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RateAggregation
impl Debug for RateAggregation
sourceimpl From<RateAggregation> for Aggregation
impl From<RateAggregation> for Aggregation
sourcefn from(q: RateAggregation) -> Self
fn from(q: RateAggregation) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<RateAggregation> for RateAggregation
impl PartialEq<RateAggregation> for RateAggregation
sourcefn eq(&self, other: &RateAggregation) -> bool
fn eq(&self, other: &RateAggregation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RateAggregation) -> bool
fn ne(&self, other: &RateAggregation) -> bool
This method tests for !=
.
sourceimpl Serialize for RateAggregation
impl Serialize for RateAggregation
impl StructuralPartialEq for RateAggregation
Auto Trait Implementations
impl RefUnwindSafe for RateAggregation
impl Send for RateAggregation
impl Sync for RateAggregation
impl Unpin for RateAggregation
impl UnwindSafe for RateAggregation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more