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§
source§impl 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§
source§impl Clone for RateAggregation
impl Clone for RateAggregation
source§fn clone(&self) -> RateAggregation
fn clone(&self) -> RateAggregation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RateAggregation
impl Debug for RateAggregation
source§impl From<RateAggregation> for Aggregation
impl From<RateAggregation> for Aggregation
source§fn from(q: RateAggregation) -> Self
fn from(q: RateAggregation) -> Self
source§impl PartialEq for RateAggregation
impl PartialEq for RateAggregation
source§fn eq(&self, other: &RateAggregation) -> bool
fn eq(&self, other: &RateAggregation) -> bool
self
and other
values to be equal, and is used
by ==
.