DistributionWidgetDefinition

Struct DistributionWidgetDefinition 

Source
#[non_exhaustive]
pub struct DistributionWidgetDefinition {
Show 13 fields pub custom_links: Option<Vec<WidgetCustomLink>>, pub legend_size: Option<String>, pub markers: Option<Vec<WidgetMarker>>, pub requests: Vec<DistributionWidgetRequest>, pub show_legend: Option<bool>, pub time: Option<WidgetTime>, pub title: Option<String>, pub title_align: Option<WidgetTextAlign>, pub title_size: Option<String>, pub type_: DistributionWidgetDefinitionType, pub xaxis: Option<DistributionWidgetXAxis>, pub yaxis: Option<DistributionWidgetYAxis>, pub additional_properties: BTreeMap<String, Value>, /* private fields */
}
Expand description

The Distribution visualization is another way of showing metrics aggregated across one or several tags, such as hosts. Unlike the heat map, a distribution graph’s x-axis is quantity rather than time.

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.
§custom_links: Option<Vec<WidgetCustomLink>>

A list of custom links.

§legend_size: Option<String>
👎Deprecated

(Deprecated) The widget legend was replaced by a tooltip and sidebar.

§markers: Option<Vec<WidgetMarker>>

List of markers.

§requests: Vec<DistributionWidgetRequest>

Array of one request object to display in the widget.

See the dedicated Request JSON schema documentation to learn how to build the REQUEST_SCHEMA.

§show_legend: Option<bool>
👎Deprecated

(Deprecated) The widget legend was replaced by a tooltip and sidebar.

§time: Option<WidgetTime>

Time setting for the widget.

§title: Option<String>

Title of the widget.

§title_align: Option<WidgetTextAlign>

How to align the text on the widget.

§title_size: Option<String>

Size of the title.

§type_: DistributionWidgetDefinitionType

Type of the distribution widget.

§xaxis: Option<DistributionWidgetXAxis>

X Axis controls for the distribution widget.

§yaxis: Option<DistributionWidgetYAxis>

Y Axis controls for the distribution widget.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl DistributionWidgetDefinition

Source

pub fn new( requests: Vec<DistributionWidgetRequest>, type_: DistributionWidgetDefinitionType, ) -> DistributionWidgetDefinition

Examples found in repository?
examples/v1_dashboards_CreateDashboard_803346562.rs (lines 23-34)
17async fn main() {
18    let body = Dashboard::new(
19        DashboardLayoutType::ORDERED,
20        "Example-Dashboard".to_string(),
21        vec![
22            Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(
23                DistributionWidgetDefinition::new(
24                    vec![DistributionWidgetRequest::new().apm_stats_query(
25                        ApmStatsQueryDefinition::new(
26                            "prod".to_string(),
27                            "cassandra.query".to_string(),
28                            "datacenter:dc1".to_string(),
29                            ApmStatsQueryRowType::SERVICE,
30                            "cassandra".to_string(),
31                        ),
32                    )],
33                    DistributionWidgetDefinitionType::DISTRIBUTION,
34                )
35                .title("".to_string())
36                .title_align(WidgetTextAlign::LEFT)
37                .title_size("16".to_string()),
38            )))
39            .layout(WidgetLayout::new(4, 4, 0, 0)),
40        ],
41    );
42    let configuration = datadog::Configuration::new();
43    let api = DashboardsAPI::with_config(configuration);
44    let resp = api.create_dashboard(body).await;
45    if let Ok(value) = resp {
46        println!("{:#?}", value);
47    } else {
48        println!("{:#?}", resp.unwrap_err());
49    }
50}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_252716965.rs (lines 33-52)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
examples/v1_dashboards_CreateDashboard_3882428227.rs (lines 34-61)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (lines 33-59)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (lines 53-59)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn legend_size(self, value: String) -> Self

Source

pub fn markers(self, value: Vec<WidgetMarker>) -> Self

Source

pub fn show_legend(self, value: bool) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (line 60)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_3882428227.rs (line 62)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 60)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn time(self, value: WidgetTime) -> Self

Source

pub fn title(self, value: String) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_803346562.rs (line 35)
17async fn main() {
18    let body = Dashboard::new(
19        DashboardLayoutType::ORDERED,
20        "Example-Dashboard".to_string(),
21        vec![
22            Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(
23                DistributionWidgetDefinition::new(
24                    vec![DistributionWidgetRequest::new().apm_stats_query(
25                        ApmStatsQueryDefinition::new(
26                            "prod".to_string(),
27                            "cassandra.query".to_string(),
28                            "datacenter:dc1".to_string(),
29                            ApmStatsQueryRowType::SERVICE,
30                            "cassandra".to_string(),
31                        ),
32                    )],
33                    DistributionWidgetDefinitionType::DISTRIBUTION,
34                )
35                .title("".to_string())
36                .title_align(WidgetTextAlign::LEFT)
37                .title_size("16".to_string()),
38            )))
39            .layout(WidgetLayout::new(4, 4, 0, 0)),
40        ],
41    );
42    let configuration = datadog::Configuration::new();
43    let api = DashboardsAPI::with_config(configuration);
44    let resp = api.create_dashboard(body).await;
45    if let Ok(value) = resp {
46        println!("{:#?}", value);
47    } else {
48        println!("{:#?}", resp.unwrap_err());
49    }
50}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_252716965.rs (line 61)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
examples/v1_dashboards_CreateDashboard_3882428227.rs (line 63)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 61)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn title_align(self, value: WidgetTextAlign) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_803346562.rs (line 36)
17async fn main() {
18    let body = Dashboard::new(
19        DashboardLayoutType::ORDERED,
20        "Example-Dashboard".to_string(),
21        vec![
22            Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(
23                DistributionWidgetDefinition::new(
24                    vec![DistributionWidgetRequest::new().apm_stats_query(
25                        ApmStatsQueryDefinition::new(
26                            "prod".to_string(),
27                            "cassandra.query".to_string(),
28                            "datacenter:dc1".to_string(),
29                            ApmStatsQueryRowType::SERVICE,
30                            "cassandra".to_string(),
31                        ),
32                    )],
33                    DistributionWidgetDefinitionType::DISTRIBUTION,
34                )
35                .title("".to_string())
36                .title_align(WidgetTextAlign::LEFT)
37                .title_size("16".to_string()),
38            )))
39            .layout(WidgetLayout::new(4, 4, 0, 0)),
40        ],
41    );
42    let configuration = datadog::Configuration::new();
43    let api = DashboardsAPI::with_config(configuration);
44    let resp = api.create_dashboard(body).await;
45    if let Ok(value) = resp {
46        println!("{:#?}", value);
47    } else {
48        println!("{:#?}", resp.unwrap_err());
49    }
50}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_252716965.rs (line 62)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
examples/v1_dashboards_CreateDashboard_3882428227.rs (line 64)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 62)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn title_size(self, value: String) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_803346562.rs (line 37)
17async fn main() {
18    let body = Dashboard::new(
19        DashboardLayoutType::ORDERED,
20        "Example-Dashboard".to_string(),
21        vec![
22            Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(
23                DistributionWidgetDefinition::new(
24                    vec![DistributionWidgetRequest::new().apm_stats_query(
25                        ApmStatsQueryDefinition::new(
26                            "prod".to_string(),
27                            "cassandra.query".to_string(),
28                            "datacenter:dc1".to_string(),
29                            ApmStatsQueryRowType::SERVICE,
30                            "cassandra".to_string(),
31                        ),
32                    )],
33                    DistributionWidgetDefinitionType::DISTRIBUTION,
34                )
35                .title("".to_string())
36                .title_align(WidgetTextAlign::LEFT)
37                .title_size("16".to_string()),
38            )))
39            .layout(WidgetLayout::new(4, 4, 0, 0)),
40        ],
41    );
42    let configuration = datadog::Configuration::new();
43    let api = DashboardsAPI::with_config(configuration);
44    let resp = api.create_dashboard(body).await;
45    if let Ok(value) = resp {
46        println!("{:#?}", value);
47    } else {
48        println!("{:#?}", resp.unwrap_err());
49    }
50}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_252716965.rs (line 63)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
examples/v1_dashboards_CreateDashboard_3882428227.rs (line 65)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (line 63)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn xaxis(self, value: DistributionWidgetXAxis) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (lines 64-70)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_3882428227.rs (lines 66-72)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (lines 64-70)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn yaxis(self, value: DistributionWidgetYAxis) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (lines 71-77)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionMetricQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionMetricQueryDefinition::new(
41                                                        FormulaAndFunctionMetricDataSource::METRICS,
42                                                        "query1".to_string(),
43                                                        "histogram:trace.Load{*}".to_string(),
44                                                    ),
45                                                ),
46                                            ),
47                                        )
48                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
50                                ],
51                                DistributionWidgetDefinitionType::DISTRIBUTION,
52                            )
53                                .custom_links(
54                                    vec![
55                                        WidgetCustomLink::new()
56                                            .label("Example".to_string())
57                                            .link("https://example.org/".to_string())
58                                    ],
59                                )
60                                .show_legend(false)
61                                .title("Metrics HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 0, 0))
81            ],
82        );
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_3882428227.rs (lines 73-79)
25async fn main() {
26    let body =
27        Dashboard::new(
28            DashboardLayoutType::ORDERED,
29            "Example-Dashboard".to_string(),
30            vec![
31                Widget::new(
32                    WidgetDefinition::DistributionWidgetDefinition(
33                        Box::new(
34                            DistributionWidgetDefinition::new(
35                                vec![
36                                    DistributionWidgetRequest::new()
37                                        .query(
38                                            DistributionWidgetHistogramRequestQuery
39                                            ::FormulaAndFunctionEventQueryDefinition(
40                                                Box::new(
41                                                    FormulaAndFunctionEventQueryDefinition::new(
42                                                        FormulaAndFunctionEventQueryDefinitionCompute::new(
43                                                            FormulaAndFunctionEventAggregation::MIN,
44                                                        ).metric("@duration".to_string()),
45                                                        FormulaAndFunctionEventsDataSource::EVENTS,
46                                                        "query1".to_string(),
47                                                    )
48                                                        .group_by(vec![])
49                                                        .indexes(vec!["*".to_string()])
50                                                        .search(
51                                                            FormulaAndFunctionEventQueryDefinitionSearch::new(
52                                                                "".to_string(),
53                                                            ),
54                                                        ),
55                                                ),
56                                            ),
57                                        )
58                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
59                                ],
60                                DistributionWidgetDefinitionType::DISTRIBUTION,
61                            )
62                                .show_legend(false)
63                                .title("Events Platform - Request latency HOP".to_string())
64                                .title_align(WidgetTextAlign::LEFT)
65                                .title_size("16".to_string())
66                                .xaxis(
67                                    DistributionWidgetXAxis::new()
68                                        .include_zero(true)
69                                        .max("auto".to_string())
70                                        .min("auto".to_string())
71                                        .scale("linear".to_string()),
72                                )
73                                .yaxis(
74                                    DistributionWidgetYAxis::new()
75                                        .include_zero(true)
76                                        .max("auto".to_string())
77                                        .min("auto".to_string())
78                                        .scale("linear".to_string()),
79                                ),
80                        ),
81                    ),
82                ).layout(WidgetLayout::new(2, 4, 0, 0))
83            ],
84        ).description(Some("Example-Dashboard".to_string()));
85    let configuration = datadog::Configuration::new();
86    let api = DashboardsAPI::with_config(configuration);
87    let resp = api.create_dashboard(body).await;
88    if let Ok(value) = resp {
89        println!("{:#?}", value);
90    } else {
91        println!("{:#?}", resp.unwrap_err());
92    }
93}
examples/v1_dashboards_CreateDashboard_1442588603.rs (lines 71-77)
24async fn main() {
25    let body =
26        Dashboard::new(
27            DashboardLayoutType::ORDERED,
28            "Example-Dashboard".to_string(),
29            vec![
30                Widget::new(
31                    WidgetDefinition::DistributionWidgetDefinition(
32                        Box::new(
33                            DistributionWidgetDefinition::new(
34                                vec![
35                                    DistributionWidgetRequest::new()
36                                        .query(
37                                            DistributionWidgetHistogramRequestQuery
38                                            ::FormulaAndFunctionApmResourceStatsQueryDefinition(
39                                                Box::new(
40                                                    FormulaAndFunctionApmResourceStatsQueryDefinition::new(
41                                                        FormulaAndFunctionApmResourceStatsDataSource
42                                                        ::APM_RESOURCE_STATS,
43                                                        "staging".to_string(),
44                                                        "query1".to_string(),
45                                                        "azure-bill-import".to_string(),
46                                                        FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,
47                                                    )
48                                                        .group_by(vec!["resource_name".to_string()])
49                                                        .operation_name("universal.http.client".to_string())
50                                                        .primary_tag_name("datacenter".to_string())
51                                                        .primary_tag_value("*".to_string()),
52                                                ),
53                                            ),
54                                        )
55                                        .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
56                                        .style(WidgetStyle::new().palette("dog_classic".to_string()))
57                                ],
58                                DistributionWidgetDefinitionType::DISTRIBUTION,
59                            )
60                                .show_legend(false)
61                                .title("APM Stats - Request latency HOP".to_string())
62                                .title_align(WidgetTextAlign::LEFT)
63                                .title_size("16".to_string())
64                                .xaxis(
65                                    DistributionWidgetXAxis::new()
66                                        .include_zero(true)
67                                        .max("auto".to_string())
68                                        .min("auto".to_string())
69                                        .scale("linear".to_string()),
70                                )
71                                .yaxis(
72                                    DistributionWidgetYAxis::new()
73                                        .include_zero(true)
74                                        .max("auto".to_string())
75                                        .min("auto".to_string())
76                                        .scale("linear".to_string()),
77                                ),
78                        ),
79                    ),
80                ).layout(WidgetLayout::new(2, 4, 8, 0))
81            ],
82        ).description(Some("".to_string()));
83    let configuration = datadog::Configuration::new();
84    let api = DashboardsAPI::with_config(configuration);
85    let resp = api.create_dashboard(body).await;
86    if let Ok(value) = resp {
87        println!("{:#?}", value);
88    } else {
89        println!("{:#?}", resp.unwrap_err());
90    }
91}
Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for DistributionWidgetDefinition

Source§

fn clone(&self) -> DistributionWidgetDefinition

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DistributionWidgetDefinition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DistributionWidgetDefinition

Source§

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 DistributionWidgetDefinition

Source§

fn eq(&self, other: &DistributionWidgetDefinition) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DistributionWidgetDefinition

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DistributionWidgetDefinition

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,