#[non_exhaustive]pub struct SplitGraphWidgetDefinition {
pub has_uniform_y_axes: Option<bool>,
pub size: SplitGraphVizSize,
pub source_widget_definition: SplitGraphSourceWidgetDefinition,
pub split_config: SplitConfig,
pub time: Option<WidgetTime>,
pub title: Option<String>,
pub type_: SplitGraphWidgetDefinitionType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The split graph widget allows you to create repeating units of a graph - one for each value in a group (for example: one per service)
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.has_uniform_y_axes: Option<bool>
Normalize y axes across graphs
size: SplitGraphVizSize
Size of the individual graphs in the split.
source_widget_definition: SplitGraphSourceWidgetDefinition
The original widget we are splitting on.
split_config: SplitConfig
Encapsulates all user choices about how to split a graph.
time: Option<WidgetTime>
Time setting for the widget.
title: Option<String>
Title of your widget.
type_: SplitGraphWidgetDefinitionType
Type of the split graph widget
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl SplitGraphWidgetDefinition
impl SplitGraphWidgetDefinition
Sourcepub fn new(
size: SplitGraphVizSize,
source_widget_definition: SplitGraphSourceWidgetDefinition,
split_config: SplitConfig,
type_: SplitGraphWidgetDefinitionType,
) -> SplitGraphWidgetDefinition
pub fn new( size: SplitGraphVizSize, source_widget_definition: SplitGraphSourceWidgetDefinition, split_config: SplitConfig, type_: SplitGraphWidgetDefinitionType, ) -> SplitGraphWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2278756614.rs (lines 42-100)
33async fn main() {
34 let body =
35 Dashboard::new(
36 DashboardLayoutType::ORDERED,
37 "Example-Dashboard".to_string(),
38 vec![
39 Widget::new(
40 WidgetDefinition::SplitGraphWidgetDefinition(
41 Box::new(
42 SplitGraphWidgetDefinition::new(
43 SplitGraphVizSize::MD,
44 SplitGraphSourceWidgetDefinition::TimeseriesWidgetDefinition(
45 Box::new(
46 TimeseriesWidgetDefinition::new(
47 vec![
48 TimeseriesWidgetRequest::new()
49 .display_type(WidgetDisplayType::LINE)
50 .queries(
51 vec![
52 FormulaAndFunctionQueryDefinition
53 ::FormulaAndFunctionMetricQueryDefinition(
54 Box::new(
55 FormulaAndFunctionMetricQueryDefinition::new(
56 FormulaAndFunctionMetricDataSource::METRICS,
57 "query1".to_string(),
58 "avg:system.cpu.user{*}".to_string(),
59 ),
60 ),
61 )
62 ],
63 )
64 .response_format(FormulaAndFunctionResponseFormat::TIMESERIES)
65 .style(
66 WidgetRequestStyle::new()
67 .line_type(WidgetLineType::SOLID)
68 .line_width(WidgetLineWidth::NORMAL)
69 .palette("dog_classic".to_string()),
70 )
71 ],
72 TimeseriesWidgetDefinitionType::TIMESERIES,
73 )
74 .title("".to_string())
75 .title_align(WidgetTextAlign::LEFT)
76 .title_size("16".to_string()),
77 ),
78 ),
79 SplitConfig::new(
80 24,
81 SplitSort::new(
82 WidgetSort::DESCENDING,
83 ).compute(
84 SplitConfigSortCompute::new("sum".to_string(), "system.cpu.user".to_string()),
85 ),
86 vec![SplitDimension::new("service".to_string())],
87 ).static_splits(
88 vec![
89 vec![
90 SplitVectorEntryItem::new(
91 "service".to_string(),
92 vec!["cassandra".to_string()],
93 ),
94 SplitVectorEntryItem::new("datacenter".to_string(), vec![])
95 ],
96 vec![SplitVectorEntryItem::new("demo".to_string(), vec!["env".to_string()])]
97 ],
98 ),
99 SplitGraphWidgetDefinitionType::SPLIT_GROUP,
100 )
101 .has_uniform_y_axes(true)
102 .title("".to_string()),
103 ),
104 ),
105 ).layout(WidgetLayout::new(8, 12, 0, 0))
106 ],
107 )
108 .description(Some("".to_string()))
109 .notify_list(Some(vec![]))
110 .template_variables(Some(vec![]));
111 let configuration = datadog::Configuration::new();
112 let api = DashboardsAPI::with_config(configuration);
113 let resp = api.create_dashboard(body).await;
114 if let Ok(value) = resp {
115 println!("{:#?}", value);
116 } else {
117 println!("{:#?}", resp.unwrap_err());
118 }
119}
Sourcepub fn has_uniform_y_axes(self, value: bool) -> Self
pub fn has_uniform_y_axes(self, value: bool) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2278756614.rs (line 101)
33async fn main() {
34 let body =
35 Dashboard::new(
36 DashboardLayoutType::ORDERED,
37 "Example-Dashboard".to_string(),
38 vec![
39 Widget::new(
40 WidgetDefinition::SplitGraphWidgetDefinition(
41 Box::new(
42 SplitGraphWidgetDefinition::new(
43 SplitGraphVizSize::MD,
44 SplitGraphSourceWidgetDefinition::TimeseriesWidgetDefinition(
45 Box::new(
46 TimeseriesWidgetDefinition::new(
47 vec![
48 TimeseriesWidgetRequest::new()
49 .display_type(WidgetDisplayType::LINE)
50 .queries(
51 vec![
52 FormulaAndFunctionQueryDefinition
53 ::FormulaAndFunctionMetricQueryDefinition(
54 Box::new(
55 FormulaAndFunctionMetricQueryDefinition::new(
56 FormulaAndFunctionMetricDataSource::METRICS,
57 "query1".to_string(),
58 "avg:system.cpu.user{*}".to_string(),
59 ),
60 ),
61 )
62 ],
63 )
64 .response_format(FormulaAndFunctionResponseFormat::TIMESERIES)
65 .style(
66 WidgetRequestStyle::new()
67 .line_type(WidgetLineType::SOLID)
68 .line_width(WidgetLineWidth::NORMAL)
69 .palette("dog_classic".to_string()),
70 )
71 ],
72 TimeseriesWidgetDefinitionType::TIMESERIES,
73 )
74 .title("".to_string())
75 .title_align(WidgetTextAlign::LEFT)
76 .title_size("16".to_string()),
77 ),
78 ),
79 SplitConfig::new(
80 24,
81 SplitSort::new(
82 WidgetSort::DESCENDING,
83 ).compute(
84 SplitConfigSortCompute::new("sum".to_string(), "system.cpu.user".to_string()),
85 ),
86 vec![SplitDimension::new("service".to_string())],
87 ).static_splits(
88 vec![
89 vec![
90 SplitVectorEntryItem::new(
91 "service".to_string(),
92 vec!["cassandra".to_string()],
93 ),
94 SplitVectorEntryItem::new("datacenter".to_string(), vec![])
95 ],
96 vec![SplitVectorEntryItem::new("demo".to_string(), vec!["env".to_string()])]
97 ],
98 ),
99 SplitGraphWidgetDefinitionType::SPLIT_GROUP,
100 )
101 .has_uniform_y_axes(true)
102 .title("".to_string()),
103 ),
104 ),
105 ).layout(WidgetLayout::new(8, 12, 0, 0))
106 ],
107 )
108 .description(Some("".to_string()))
109 .notify_list(Some(vec![]))
110 .template_variables(Some(vec![]));
111 let configuration = datadog::Configuration::new();
112 let api = DashboardsAPI::with_config(configuration);
113 let resp = api.create_dashboard(body).await;
114 if let Ok(value) = resp {
115 println!("{:#?}", value);
116 } else {
117 println!("{:#?}", resp.unwrap_err());
118 }
119}
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_2278756614.rs (line 102)
33async fn main() {
34 let body =
35 Dashboard::new(
36 DashboardLayoutType::ORDERED,
37 "Example-Dashboard".to_string(),
38 vec![
39 Widget::new(
40 WidgetDefinition::SplitGraphWidgetDefinition(
41 Box::new(
42 SplitGraphWidgetDefinition::new(
43 SplitGraphVizSize::MD,
44 SplitGraphSourceWidgetDefinition::TimeseriesWidgetDefinition(
45 Box::new(
46 TimeseriesWidgetDefinition::new(
47 vec![
48 TimeseriesWidgetRequest::new()
49 .display_type(WidgetDisplayType::LINE)
50 .queries(
51 vec![
52 FormulaAndFunctionQueryDefinition
53 ::FormulaAndFunctionMetricQueryDefinition(
54 Box::new(
55 FormulaAndFunctionMetricQueryDefinition::new(
56 FormulaAndFunctionMetricDataSource::METRICS,
57 "query1".to_string(),
58 "avg:system.cpu.user{*}".to_string(),
59 ),
60 ),
61 )
62 ],
63 )
64 .response_format(FormulaAndFunctionResponseFormat::TIMESERIES)
65 .style(
66 WidgetRequestStyle::new()
67 .line_type(WidgetLineType::SOLID)
68 .line_width(WidgetLineWidth::NORMAL)
69 .palette("dog_classic".to_string()),
70 )
71 ],
72 TimeseriesWidgetDefinitionType::TIMESERIES,
73 )
74 .title("".to_string())
75 .title_align(WidgetTextAlign::LEFT)
76 .title_size("16".to_string()),
77 ),
78 ),
79 SplitConfig::new(
80 24,
81 SplitSort::new(
82 WidgetSort::DESCENDING,
83 ).compute(
84 SplitConfigSortCompute::new("sum".to_string(), "system.cpu.user".to_string()),
85 ),
86 vec![SplitDimension::new("service".to_string())],
87 ).static_splits(
88 vec![
89 vec![
90 SplitVectorEntryItem::new(
91 "service".to_string(),
92 vec!["cassandra".to_string()],
93 ),
94 SplitVectorEntryItem::new("datacenter".to_string(), vec![])
95 ],
96 vec![SplitVectorEntryItem::new("demo".to_string(), vec!["env".to_string()])]
97 ],
98 ),
99 SplitGraphWidgetDefinitionType::SPLIT_GROUP,
100 )
101 .has_uniform_y_axes(true)
102 .title("".to_string()),
103 ),
104 ),
105 ).layout(WidgetLayout::new(8, 12, 0, 0))
106 ],
107 )
108 .description(Some("".to_string()))
109 .notify_list(Some(vec![]))
110 .template_variables(Some(vec![]));
111 let configuration = datadog::Configuration::new();
112 let api = DashboardsAPI::with_config(configuration);
113 let resp = api.create_dashboard(body).await;
114 if let Ok(value) = resp {
115 println!("{:#?}", value);
116 } else {
117 println!("{:#?}", resp.unwrap_err());
118 }
119}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for SplitGraphWidgetDefinition
impl Clone for SplitGraphWidgetDefinition
Source§fn clone(&self) -> SplitGraphWidgetDefinition
fn clone(&self) -> SplitGraphWidgetDefinition
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 SplitGraphWidgetDefinition
impl Debug for SplitGraphWidgetDefinition
Source§impl<'de> Deserialize<'de> for SplitGraphWidgetDefinition
impl<'de> Deserialize<'de> for SplitGraphWidgetDefinition
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
impl StructuralPartialEq for SplitGraphWidgetDefinition
Auto Trait Implementations§
impl Freeze for SplitGraphWidgetDefinition
impl RefUnwindSafe for SplitGraphWidgetDefinition
impl Send for SplitGraphWidgetDefinition
impl Sync for SplitGraphWidgetDefinition
impl Unpin for SplitGraphWidgetDefinition
impl UnwindSafe for SplitGraphWidgetDefinition
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