pub struct RumMetricsAPI { /* private fields */ }
Expand description
Manage configuration of rum-based metrics for your organization.
Implementations§
Source§impl RumMetricsAPI
impl RumMetricsAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
6async fn main() {
7 // there is a valid "rum_metric" in the system
8 let rum_metric_data_id = std::env::var("RUM_METRIC_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = RumMetricsAPI::with_config(configuration);
11 let resp = api.get_rum_metric(rum_metric_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
6async fn main() {
7 // there is a valid "rum_metric" in the system
8 let rum_metric_data_id = std::env::var("RUM_METRIC_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = RumMetricsAPI::with_config(configuration);
11 let resp = api.delete_rum_metric(rum_metric_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
13async fn main() {
14 // there is a valid "rum_metric" in the system
15 let rum_metric_data_id = std::env::var("RUM_METRIC_DATA_ID").unwrap();
16 let body = RumMetricUpdateRequest::new(
17 RumMetricUpdateData::new(
18 RumMetricUpdateAttributes::new()
19 .compute(RumMetricUpdateCompute::new().include_percentiles(false))
20 .filter(RumMetricFilter::new("@service:rum-config".to_string()))
21 .group_by(vec![RumMetricGroupBy::new("@browser.version".to_string())
22 .tag_name("browser_version".to_string())]),
23 RumMetricType::RUM_METRICS,
24 )
25 .id(rum_metric_data_id.clone()),
26 );
27 let configuration = datadog::Configuration::new();
28 let api = RumMetricsAPI::with_config(configuration);
29 let resp = api
30 .update_rum_metric(rum_metric_data_id.clone(), body)
31 .await;
32 if let Ok(value) = resp {
33 println!("{:#?}", value);
34 } else {
35 println!("{:#?}", resp.unwrap_err());
36 }
37}
17async fn main() {
18 let body = RumMetricCreateRequest::new(RumMetricCreateData::new(
19 RumMetricCreateAttributes::new(
20 RumMetricCompute::new(RumMetricComputeAggregationType::DISTRIBUTION)
21 .include_percentiles(true)
22 .path("@duration".to_string()),
23 RumMetricEventType::SESSION,
24 )
25 .filter(RumMetricFilter::new("@service:web-ui".to_string()))
26 .group_by(vec![
27 RumMetricGroupBy::new("@browser.name".to_string()).tag_name("browser_name".to_string())
28 ])
29 .uniqueness(RumMetricUniqueness::new(
30 RumMetricUniquenessWhen::WHEN_MATCH,
31 )),
32 "examplerummetric".to_string(),
33 RumMetricType::RUM_METRICS,
34 ));
35 let configuration = datadog::Configuration::new();
36 let api = RumMetricsAPI::with_config(configuration);
37 let resp = api.create_rum_metric(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_rum_metric(
&self,
body: RumMetricCreateRequest,
) -> Result<RumMetricResponse, Error<CreateRumMetricError>>
pub async fn create_rum_metric( &self, body: RumMetricCreateRequest, ) -> Result<RumMetricResponse, Error<CreateRumMetricError>>
Create a metric based on your organization’s RUM data. Returns the rum-based metric object from the request body when the request is successful.
Examples found in repository?
17async fn main() {
18 let body = RumMetricCreateRequest::new(RumMetricCreateData::new(
19 RumMetricCreateAttributes::new(
20 RumMetricCompute::new(RumMetricComputeAggregationType::DISTRIBUTION)
21 .include_percentiles(true)
22 .path("@duration".to_string()),
23 RumMetricEventType::SESSION,
24 )
25 .filter(RumMetricFilter::new("@service:web-ui".to_string()))
26 .group_by(vec![
27 RumMetricGroupBy::new("@browser.name".to_string()).tag_name("browser_name".to_string())
28 ])
29 .uniqueness(RumMetricUniqueness::new(
30 RumMetricUniquenessWhen::WHEN_MATCH,
31 )),
32 "examplerummetric".to_string(),
33 RumMetricType::RUM_METRICS,
34 ));
35 let configuration = datadog::Configuration::new();
36 let api = RumMetricsAPI::with_config(configuration);
37 let resp = api.create_rum_metric(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
Sourcepub async fn create_rum_metric_with_http_info(
&self,
body: RumMetricCreateRequest,
) -> Result<ResponseContent<RumMetricResponse>, Error<CreateRumMetricError>>
pub async fn create_rum_metric_with_http_info( &self, body: RumMetricCreateRequest, ) -> Result<ResponseContent<RumMetricResponse>, Error<CreateRumMetricError>>
Create a metric based on your organization’s RUM data. Returns the rum-based metric object from the request body when the request is successful.
Sourcepub async fn delete_rum_metric(
&self,
metric_id: String,
) -> Result<(), Error<DeleteRumMetricError>>
pub async fn delete_rum_metric( &self, metric_id: String, ) -> Result<(), Error<DeleteRumMetricError>>
Delete a specific rum-based metric from your organization.
Examples found in repository?
6async fn main() {
7 // there is a valid "rum_metric" in the system
8 let rum_metric_data_id = std::env::var("RUM_METRIC_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = RumMetricsAPI::with_config(configuration);
11 let resp = api.delete_rum_metric(rum_metric_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn delete_rum_metric_with_http_info(
&self,
metric_id: String,
) -> Result<ResponseContent<()>, Error<DeleteRumMetricError>>
pub async fn delete_rum_metric_with_http_info( &self, metric_id: String, ) -> Result<ResponseContent<()>, Error<DeleteRumMetricError>>
Delete a specific rum-based metric from your organization.
Sourcepub async fn get_rum_metric(
&self,
metric_id: String,
) -> Result<RumMetricResponse, Error<GetRumMetricError>>
pub async fn get_rum_metric( &self, metric_id: String, ) -> Result<RumMetricResponse, Error<GetRumMetricError>>
Get a specific rum-based metric from your organization.
Examples found in repository?
6async fn main() {
7 // there is a valid "rum_metric" in the system
8 let rum_metric_data_id = std::env::var("RUM_METRIC_DATA_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = RumMetricsAPI::with_config(configuration);
11 let resp = api.get_rum_metric(rum_metric_data_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn get_rum_metric_with_http_info(
&self,
metric_id: String,
) -> Result<ResponseContent<RumMetricResponse>, Error<GetRumMetricError>>
pub async fn get_rum_metric_with_http_info( &self, metric_id: String, ) -> Result<ResponseContent<RumMetricResponse>, Error<GetRumMetricError>>
Get a specific rum-based metric from your organization.
Sourcepub async fn list_rum_metrics(
&self,
) -> Result<RumMetricsResponse, Error<ListRumMetricsError>>
pub async fn list_rum_metrics( &self, ) -> Result<RumMetricsResponse, Error<ListRumMetricsError>>
Get the list of configured rum-based metrics with their definitions.
Sourcepub async fn list_rum_metrics_with_http_info(
&self,
) -> Result<ResponseContent<RumMetricsResponse>, Error<ListRumMetricsError>>
pub async fn list_rum_metrics_with_http_info( &self, ) -> Result<ResponseContent<RumMetricsResponse>, Error<ListRumMetricsError>>
Get the list of configured rum-based metrics with their definitions.
Sourcepub async fn update_rum_metric(
&self,
metric_id: String,
body: RumMetricUpdateRequest,
) -> Result<RumMetricResponse, Error<UpdateRumMetricError>>
pub async fn update_rum_metric( &self, metric_id: String, body: RumMetricUpdateRequest, ) -> Result<RumMetricResponse, Error<UpdateRumMetricError>>
Update a specific rum-based metric from your organization. Returns the rum-based metric object from the request body when the request is successful.
Examples found in repository?
13async fn main() {
14 // there is a valid "rum_metric" in the system
15 let rum_metric_data_id = std::env::var("RUM_METRIC_DATA_ID").unwrap();
16 let body = RumMetricUpdateRequest::new(
17 RumMetricUpdateData::new(
18 RumMetricUpdateAttributes::new()
19 .compute(RumMetricUpdateCompute::new().include_percentiles(false))
20 .filter(RumMetricFilter::new("@service:rum-config".to_string()))
21 .group_by(vec![RumMetricGroupBy::new("@browser.version".to_string())
22 .tag_name("browser_version".to_string())]),
23 RumMetricType::RUM_METRICS,
24 )
25 .id(rum_metric_data_id.clone()),
26 );
27 let configuration = datadog::Configuration::new();
28 let api = RumMetricsAPI::with_config(configuration);
29 let resp = api
30 .update_rum_metric(rum_metric_data_id.clone(), body)
31 .await;
32 if let Ok(value) = resp {
33 println!("{:#?}", value);
34 } else {
35 println!("{:#?}", resp.unwrap_err());
36 }
37}
Sourcepub async fn update_rum_metric_with_http_info(
&self,
metric_id: String,
body: RumMetricUpdateRequest,
) -> Result<ResponseContent<RumMetricResponse>, Error<UpdateRumMetricError>>
pub async fn update_rum_metric_with_http_info( &self, metric_id: String, body: RumMetricUpdateRequest, ) -> Result<ResponseContent<RumMetricResponse>, Error<UpdateRumMetricError>>
Update a specific rum-based metric from your organization. Returns the rum-based metric object from the request body when the request is successful.
Trait Implementations§
Source§impl Clone for RumMetricsAPI
impl Clone for RumMetricsAPI
Source§fn clone(&self) -> RumMetricsAPI
fn clone(&self) -> RumMetricsAPI
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more