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<T>(self, field: T) -> Selfwhere
T: ToString,
pub fn field<T>(self, field: T) -> Selfwhere
T: ToString,
Calculate sum or number of values of the field
sourcepub fn unit(self, unit: CalendarInterval) -> Self
pub fn unit(self, unit: 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
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more