#[non_exhaustive]pub struct CIAppCompute {
pub aggregation: CIAppAggregationFunction,
pub interval: Option<String>,
pub metric: Option<String>,
pub type_: Option<CIAppComputeType>,
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: CIAppAggregationFunction
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<CIAppComputeType>
The type of compute.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CIAppCompute
impl CIAppCompute
Sourcepub fn new(aggregation: CIAppAggregationFunction) -> CIAppCompute
pub fn new(aggregation: CIAppAggregationFunction) -> CIAppCompute
Examples found in repository?
examples/v2_ci-visibility-pipelines_AggregateCIAppPipelineEvents.rs (lines 16-18)
14async fn main() {
15 let body = CIAppPipelinesAggregateRequest::new()
16 .compute(vec![CIAppCompute::new(
17 CIAppAggregationFunction::PERCENTILE_90,
18 )
19 .metric("@duration".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppPipelinesQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@ci.provider.name:(gitlab OR github)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppPipelinesGroupBy::new("@ci.status".to_string())
28 .limit(10)
29 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
30 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
31 let configuration = datadog::Configuration::new();
32 let api = CIVisibilityPipelinesAPI::with_config(configuration);
33 let resp = api.aggregate_ci_app_pipeline_events(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
More examples
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (line 18)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
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_ci-visibility-pipelines_AggregateCIAppPipelineEvents.rs (line 19)
14async fn main() {
15 let body = CIAppPipelinesAggregateRequest::new()
16 .compute(vec![CIAppCompute::new(
17 CIAppAggregationFunction::PERCENTILE_90,
18 )
19 .metric("@duration".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppPipelinesQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@ci.provider.name:(gitlab OR github)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppPipelinesGroupBy::new("@ci.status".to_string())
28 .limit(10)
29 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
30 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
31 let configuration = datadog::Configuration::new();
32 let api = CIVisibilityPipelinesAPI::with_config(configuration);
33 let resp = api.aggregate_ci_app_pipeline_events(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
More examples
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (line 19)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
Sourcepub fn type_(self, value: CIAppComputeType) -> Self
pub fn type_(self, value: CIAppComputeType) -> Self
Examples found in repository?
examples/v2_ci-visibility-pipelines_AggregateCIAppPipelineEvents.rs (line 20)
14async fn main() {
15 let body = CIAppPipelinesAggregateRequest::new()
16 .compute(vec![CIAppCompute::new(
17 CIAppAggregationFunction::PERCENTILE_90,
18 )
19 .metric("@duration".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppPipelinesQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@ci.provider.name:(gitlab OR github)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppPipelinesGroupBy::new("@ci.status".to_string())
28 .limit(10)
29 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
30 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
31 let configuration = datadog::Configuration::new();
32 let api = CIVisibilityPipelinesAPI::with_config(configuration);
33 let resp = api.aggregate_ci_app_pipeline_events(body).await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
More examples
examples/v2_ci-visibility-tests_AggregateCIAppTestEvents.rs (line 20)
16async fn main() {
17 let body = CIAppTestsAggregateRequest::new()
18 .compute(vec![CIAppCompute::new(CIAppAggregationFunction::COUNT)
19 .metric("@test.is_flaky".to_string())
20 .type_(CIAppComputeType::TOTAL)])
21 .filter(
22 CIAppTestsQueryFilter::new()
23 .from("now-15m".to_string())
24 .query("@language:(python OR go)".to_string())
25 .to("now".to_string()),
26 )
27 .group_by(vec![CIAppTestsGroupBy::new("@git.branch".to_string())
28 .limit(10)
29 .sort(CIAppAggregateSort::new().order(CIAppSortOrder::ASCENDING))
30 .total(CIAppGroupByTotal::CIAppGroupByTotalBoolean(false))])
31 .options(CIAppQueryOptions::new().timezone("GMT".to_string()));
32 let configuration = datadog::Configuration::new();
33 let api = CIVisibilityTestsAPI::with_config(configuration);
34 let resp = api.aggregate_ci_app_test_events(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CIAppCompute
impl Clone for CIAppCompute
Source§fn clone(&self) -> CIAppCompute
fn clone(&self) -> CIAppCompute
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 CIAppCompute
impl Debug for CIAppCompute
Source§impl<'de> Deserialize<'de> for CIAppCompute
impl<'de> Deserialize<'de> for CIAppCompute
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 CIAppCompute
impl PartialEq for CIAppCompute
Source§impl Serialize for CIAppCompute
impl Serialize for CIAppCompute
impl StructuralPartialEq for CIAppCompute
Auto Trait Implementations§
impl Freeze for CIAppCompute
impl RefUnwindSafe for CIAppCompute
impl Send for CIAppCompute
impl Sync for CIAppCompute
impl Unpin for CIAppCompute
impl UnwindSafe for CIAppCompute
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