#[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
impl DistributionWidgetDefinition
Sourcepub fn new(
requests: Vec<DistributionWidgetRequest>,
type_: DistributionWidgetDefinitionType,
) -> DistributionWidgetDefinition
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
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}
Sourcepub fn custom_links(self, value: Vec<WidgetCustomLink>) -> Self
pub fn custom_links(self, value: Vec<WidgetCustomLink>) -> Self
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}
pub fn legend_size(self, value: String) -> Self
pub fn markers(self, value: Vec<WidgetMarker>) -> Self
Sourcepub fn show_legend(self, value: bool) -> Self
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
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}
pub fn time(self, value: WidgetTime) -> Self
Sourcepub fn title(self, value: String) -> Self
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
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}
Sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
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
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}
Sourcepub fn title_size(self, value: String) -> Self
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
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}
Sourcepub fn xaxis(self, value: DistributionWidgetXAxis) -> Self
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
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}
Sourcepub fn yaxis(self, value: DistributionWidgetYAxis) -> Self
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
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}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for DistributionWidgetDefinition
impl Clone for DistributionWidgetDefinition
Source§fn clone(&self) -> DistributionWidgetDefinition
fn clone(&self) -> DistributionWidgetDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DistributionWidgetDefinition
impl Debug for DistributionWidgetDefinition
Source§impl<'de> Deserialize<'de> for DistributionWidgetDefinition
impl<'de> Deserialize<'de> for DistributionWidgetDefinition
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DistributionWidgetDefinition
impl PartialEq for DistributionWidgetDefinition
Source§fn eq(&self, other: &DistributionWidgetDefinition) -> bool
fn eq(&self, other: &DistributionWidgetDefinition) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for DistributionWidgetDefinition
Auto Trait Implementations§
impl Freeze for DistributionWidgetDefinition
impl RefUnwindSafe for DistributionWidgetDefinition
impl Send for DistributionWidgetDefinition
impl Sync for DistributionWidgetDefinition
impl Unpin for DistributionWidgetDefinition
impl UnwindSafe for DistributionWidgetDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more