#[non_exhaustive]pub struct SplitDimension {
pub one_graph_per: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}Expand description
The property by which the graph splits
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.one_graph_per: StringThe system interprets this attribute differently depending on the data source of the query being split. For metrics, it’s a tag. For the events platform, it’s an attribute or tag.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl SplitDimension
impl SplitDimension
sourcepub fn new(one_graph_per: String) -> SplitDimension
pub fn new(one_graph_per: String) -> SplitDimension
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2278756614.rs (line 86)
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
async fn main() {
let body =
Dashboard::new(
DashboardLayoutType::ORDERED,
"Example-Dashboard".to_string(),
vec![
Widget::new(
WidgetDefinition::SplitGraphWidgetDefinition(
Box::new(
SplitGraphWidgetDefinition::new(
SplitGraphVizSize::MD,
SplitGraphSourceWidgetDefinition::TimeseriesWidgetDefinition(
Box::new(
TimeseriesWidgetDefinition::new(
vec![
TimeseriesWidgetRequest::new()
.display_type(WidgetDisplayType::LINE)
.queries(
vec![
FormulaAndFunctionQueryDefinition
::FormulaAndFunctionMetricQueryDefinition(
Box::new(
FormulaAndFunctionMetricQueryDefinition::new(
FormulaAndFunctionMetricDataSource::METRICS,
"query1".to_string(),
"avg:system.cpu.user{*}".to_string(),
),
),
)
],
)
.response_format(FormulaAndFunctionResponseFormat::TIMESERIES)
.style(
WidgetRequestStyle::new()
.line_type(WidgetLineType::SOLID)
.line_width(WidgetLineWidth::NORMAL)
.palette("dog_classic".to_string()),
)
],
TimeseriesWidgetDefinitionType::TIMESERIES,
)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string()),
),
),
SplitConfig::new(
24,
SplitSort::new(
WidgetSort::DESCENDING,
).compute(
SplitConfigSortCompute::new("sum".to_string(), "system.cpu.user".to_string()),
),
vec![SplitDimension::new("service".to_string())],
).static_splits(
vec![
vec![
SplitVectorEntryItem::new(
"service".to_string(),
vec!["cassandra".to_string()],
),
SplitVectorEntryItem::new("datacenter".to_string(), vec![])
],
vec![SplitVectorEntryItem::new("demo".to_string(), vec!["env".to_string()])]
],
),
SplitGraphWidgetDefinitionType::SPLIT_GROUP,
)
.has_uniform_y_axes(true)
.title("".to_string()),
),
),
).layout(WidgetLayout::new(8, 12, 0, 0))
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
source§impl Clone for SplitDimension
impl Clone for SplitDimension
source§fn clone(&self) -> SplitDimension
fn clone(&self) -> SplitDimension
Returns a copy 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 SplitDimension
impl Debug for SplitDimension
source§impl<'de> Deserialize<'de> for SplitDimension
impl<'de> Deserialize<'de> for SplitDimension
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 SplitDimension
impl PartialEq for SplitDimension
source§impl Serialize for SplitDimension
impl Serialize for SplitDimension
impl StructuralPartialEq for SplitDimension
Auto Trait Implementations§
impl Freeze for SplitDimension
impl RefUnwindSafe for SplitDimension
impl Send for SplitDimension
impl Sync for SplitDimension
impl Unpin for SplitDimension
impl UnwindSafe for SplitDimension
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)