#[non_exhaustive]pub struct RUMCompute {
pub aggregation: RUMAggregationFunction,
pub interval: Option<String>,
pub metric: Option<String>,
pub type_: Option<RUMComputeType>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
A compute rule to compute metrics or timeseries.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.aggregation: RUMAggregationFunction
An aggregation function.
interval: Option<String>
The time buckets’ size (only used for type=timeseries) Defaults to a resolution of 150 points.
metric: Option<String>
The metric to use.
type_: Option<RUMComputeType>
The type of compute.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RUMCompute
impl RUMCompute
Sourcepub fn new(aggregation: RUMAggregationFunction) -> RUMCompute
pub fn new(aggregation: RUMAggregationFunction) -> RUMCompute
Examples found in repository?
examples/v2_rum_AggregateRUMEvents.rs (line 17)
15async fn main() {
16 let body = RUMAggregateRequest::new()
17 .compute(vec![RUMCompute::new(RUMAggregationFunction::PERCENTILE_90)
18 .metric("@view.time_spent".to_string())
19 .type_(RUMComputeType::TOTAL)])
20 .filter(
21 RUMQueryFilter::new()
22 .from("now-15m".to_string())
23 .query("@type:view AND @session.type:user".to_string())
24 .to("now".to_string()),
25 )
26 .group_by(vec![RUMGroupBy::new("@view.time_spent".to_string())
27 .limit(10)
28 .total(RUMGroupByTotal::RUMGroupByTotalBoolean(false))])
29 .options(RUMQueryOptions::new().timezone("GMT".to_string()))
30 .page(RUMQueryPageOptions::new().limit(25));
31 let configuration = datadog::Configuration::new();
32 let api = RUMAPI::with_config(configuration);
33 let resp = api.aggregate_rum_events(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
pub fn interval(self, value: String) -> Self
Sourcepub fn metric(self, value: String) -> Self
pub fn metric(self, value: String) -> Self
Examples found in repository?
examples/v2_rum_AggregateRUMEvents.rs (line 18)
15async fn main() {
16 let body = RUMAggregateRequest::new()
17 .compute(vec![RUMCompute::new(RUMAggregationFunction::PERCENTILE_90)
18 .metric("@view.time_spent".to_string())
19 .type_(RUMComputeType::TOTAL)])
20 .filter(
21 RUMQueryFilter::new()
22 .from("now-15m".to_string())
23 .query("@type:view AND @session.type:user".to_string())
24 .to("now".to_string()),
25 )
26 .group_by(vec![RUMGroupBy::new("@view.time_spent".to_string())
27 .limit(10)
28 .total(RUMGroupByTotal::RUMGroupByTotalBoolean(false))])
29 .options(RUMQueryOptions::new().timezone("GMT".to_string()))
30 .page(RUMQueryPageOptions::new().limit(25));
31 let configuration = datadog::Configuration::new();
32 let api = RUMAPI::with_config(configuration);
33 let resp = api.aggregate_rum_events(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub fn type_(self, value: RUMComputeType) -> Self
pub fn type_(self, value: RUMComputeType) -> Self
Examples found in repository?
examples/v2_rum_AggregateRUMEvents.rs (line 19)
15async fn main() {
16 let body = RUMAggregateRequest::new()
17 .compute(vec![RUMCompute::new(RUMAggregationFunction::PERCENTILE_90)
18 .metric("@view.time_spent".to_string())
19 .type_(RUMComputeType::TOTAL)])
20 .filter(
21 RUMQueryFilter::new()
22 .from("now-15m".to_string())
23 .query("@type:view AND @session.type:user".to_string())
24 .to("now".to_string()),
25 )
26 .group_by(vec![RUMGroupBy::new("@view.time_spent".to_string())
27 .limit(10)
28 .total(RUMGroupByTotal::RUMGroupByTotalBoolean(false))])
29 .options(RUMQueryOptions::new().timezone("GMT".to_string()))
30 .page(RUMQueryPageOptions::new().limit(25));
31 let configuration = datadog::Configuration::new();
32 let api = RUMAPI::with_config(configuration);
33 let resp = api.aggregate_rum_events(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for RUMCompute
impl Clone for RUMCompute
Source§fn clone(&self) -> RUMCompute
fn clone(&self) -> RUMCompute
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RUMCompute
impl Debug for RUMCompute
Source§impl<'de> Deserialize<'de> for RUMCompute
impl<'de> Deserialize<'de> for RUMCompute
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RUMCompute
impl PartialEq for RUMCompute
Source§impl Serialize for RUMCompute
impl Serialize for RUMCompute
impl StructuralPartialEq for RUMCompute
Auto Trait Implementations§
impl Freeze for RUMCompute
impl RefUnwindSafe for RUMCompute
impl Send for RUMCompute
impl Sync for RUMCompute
impl Unpin for RUMCompute
impl UnwindSafe for RUMCompute
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
Mutably borrows from an owned value. Read more