Skip to content

Commit

Permalink
Merge branch 'master' into kevinzou/bugfix_retry_forms
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzou authored Apr 2, 2024
2 parents bc1a9a0 + 7498b36 commit 5cef8bb
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-03-29 13:20:47.377297",
"spec_repo_commit": "3e55ad68"
"regenerated": "2024-04-02 13:17:34.863132",
"spec_repo_commit": "de9967cc"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-03-29 13:20:47.394748",
"spec_repo_commit": "3e55ad68"
"regenerated": "2024-04-02 13:17:34.881540",
"spec_repo_commit": "de9967cc"
}
}
}
5 changes: 3 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21742,6 +21742,7 @@ components:
If the second element is not present, the API returns null.'
items:
$ref: '#/components/schemas/Unit'
nullable: true
type: array
type: object
TimeseriesResponseSeriesList:
Expand Down Expand Up @@ -29029,8 +29030,8 @@ paths:
x-codegen-request-body-name: body
/api/v2/metrics/{metric_name}/active-configurations:
get:
description: List tags and aggregations that are actively queried on dashboards
and monitors for a given metric name.
description: List tags and aggregations that are actively queried on dashboards,
notebooks, monitors, and the Metrics Explorer for a given metric name.
operationId: ListActiveMetricConfigurations
parameters:
- $ref: '#/components/parameters/MetricName'
Expand Down
2 changes: 1 addition & 1 deletion examples/v2_metrics_query_timeseries_data_301142940.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async fn main() {
vec![TimeseriesQuery::MetricsTimeseriesQuery(Box::new(
MetricsTimeseriesQuery::new(
MetricsDataSource::METRICS,
"avg:system.cpu.user{*}".to_string(),
"avg:datadog.estimated_usage.metrics.custom{*}".to_string(),
)
.name("a".to_string()),
))],
Expand Down
4 changes: 2 additions & 2 deletions src/datadogV2/api/api_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ impl MetricsAPI {
}
}

/// List tags and aggregations that are actively queried on dashboards and monitors for a given metric name.
/// List tags and aggregations that are actively queried on dashboards, notebooks, monitors, and the Metrics Explorer for a given metric name.
pub async fn list_active_metric_configurations(
&self,
metric_name: String,
Expand All @@ -1140,7 +1140,7 @@ impl MetricsAPI {
}
}

/// List tags and aggregations that are actively queried on dashboards and monitors for a given metric name.
/// List tags and aggregations that are actively queried on dashboards, notebooks, monitors, and the Metrics Explorer for a given metric name.
pub async fn list_active_metric_configurations_with_http_info(
&self,
metric_name: String,
Expand Down
11 changes: 4 additions & 7 deletions src/datadogV2/model/model_timeseries_response_series.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub struct TimeseriesResponseSeries {
/// The first element describes the "primary unit" (for example, `bytes` in `bytes per second`).
/// The second element describes the "per unit" (for example, `second` in `bytes per second`).
/// If the second element is not present, the API returns null.
#[serde(rename = "unit")]
pub unit: Option<Vec<Option<crate::datadogV2::model::Unit>>>,
#[serde(rename = "unit", default, with = "::serde_with::rust::double_option")]
pub unit: Option<Option<Vec<Option<crate::datadogV2::model::Unit>>>>,
#[serde(skip)]
#[serde(default)]
pub(crate) _unparsed: bool,
Expand All @@ -48,7 +48,7 @@ impl TimeseriesResponseSeries {
self
}

pub fn unit(mut self, value: Vec<Option<crate::datadogV2::model::Unit>>) -> Self {
pub fn unit(mut self, value: Option<Vec<Option<crate::datadogV2::model::Unit>>>) -> Self {
self.unit = Some(value);
self
}
Expand Down Expand Up @@ -79,7 +79,7 @@ impl<'de> Deserialize<'de> for TimeseriesResponseSeries {
{
let mut group_tags: Option<Vec<String>> = None;
let mut query_index: Option<i32> = None;
let mut unit: Option<Vec<Option<crate::datadogV2::model::Unit>>> = None;
let mut unit: Option<Option<Vec<Option<crate::datadogV2::model::Unit>>>> = None;
let mut _unparsed = false;

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
Expand All @@ -98,9 +98,6 @@ impl<'de> Deserialize<'de> for TimeseriesResponseSeries {
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"unit" => {
if v.is_null() {
continue;
}
unit = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
&_ => {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-03-25T19:28:01.413Z
2024-04-01T14:20:01.994Z

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions tests/scenarios/features/v2/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,10 @@ Feature: Metrics
Given a valid "appKeyAuth" key in the system
And operation "QueryTimeseriesData" enabled
And new "QueryTimeseriesData" request
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}}
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:datadog.estimated_usage.metrics.custom{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "timeseries_request"}}
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "timeseries_response"
And the response "data.attributes.series[0].unit[0].name" is equal to "percent"

@generated @skip @team:DataDog/metrics-experience
Scenario: Update a tag configuration returns "Bad Request" response
Expand Down

0 comments on commit 5cef8bb

Please sign in to comment.