Skip to content

Commit e533a44

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix Query metrics tests (#1575)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 10fee41 commit e533a44

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-03-22 19:28:34.416292",
8-
"spec_repo_commit": "b8f385dc"
7+
"regenerated": "2024-03-25 19:47:33.782497",
8+
"spec_repo_commit": "f9b6a1cc"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-03-22 19:28:34.433708",
13-
"spec_repo_commit": "b8f385dc"
12+
"regenerated": "2024-03-25 19:47:33.800132",
13+
"spec_repo_commit": "f9b6a1cc"
1414
}
1515
}
1616
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-12-21T11:14:01.142Z"
1+
"2024-03-25T19:28:00.854Z"

cassettes/v2/Metrics_2046978582/Scalar-cross-product-query-returns-OK-response_2265152344/recording.har

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"entries": [
1010
{
11-
"_id": "f1478dc8332c5603c2b07da458f229dc",
11+
"_id": "66313324595ff213f95c9bd439cb53e4",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
@@ -26,13 +26,13 @@
2626
"value": "application/json"
2727
}
2828
],
29-
"headersSize": 562,
29+
"headersSize": 559,
3030
"httpVersion": "HTTP/1.1",
3131
"method": "POST",
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"data\":{\"attributes\":{\"formulas\":[{\"formula\":\"a\",\"limit\":{\"count\":10,\"order\":\"desc\"}}],\"from\":1671612804000,\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"a\",\"query\":\"avg:system.cpu.user{*}\"}],\"to\":1671620004000},\"type\":\"scalar_request\"}}"
35+
"text": "{\"data\":{\"attributes\":{\"formulas\":[{\"formula\":\"a\",\"limit\":{\"count\":10,\"order\":\"desc\"}}],\"from\":1711391280000,\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"a\",\"query\":\"avg:system.cpu.user{*}\"}],\"to\":1711394880000},\"type\":\"scalar_request\"}}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v2/query/scalar"
@@ -42,7 +42,7 @@
4242
"content": {
4343
"mimeType": "application/json",
4444
"size": 247,
45-
"text": "{\"data\":{\"type\":\"scalar_response\",\"attributes\":{\"columns\":[{\"name\":\"a\",\"values\":[5.173633659114822],\"type\":\"number\",\"meta\":{\"unit\":[{\"scale_factor\":1.0,\"id\":17,\"name\":\"percent\",\"plural\":\"percent\",\"family\":\"percentage\",\"short_name\":\"%\"},null]}}]}}}"
45+
"text": "{\"data\":{\"type\":\"scalar_response\",\"attributes\":{\"columns\":[{\"values\":[6.368151928283307],\"name\":\"a\",\"meta\":{\"unit\":[{\"short_name\":\"%\",\"id\":17,\"plural\":\"percent\",\"name\":\"percent\",\"family\":\"percentage\",\"scale_factor\":1.0},null]},\"type\":\"number\"}]}}}"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -51,14 +51,14 @@
5151
"value": "application/json"
5252
}
5353
],
54-
"headersSize": 626,
54+
"headersSize": 653,
5555
"httpVersion": "HTTP/1.1",
5656
"redirectURL": "",
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2022-12-21T11:14:01.147Z",
61-
"time": 427
60+
"startedDateTime": "2024-03-25T19:28:01.254Z",
61+
"time": 146
6262
}
6363
],
6464
"pages": [],
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-12-21T11:14:01.814Z"
1+
"2024-03-25T19:28:01.413Z"

cassettes/v2/Metrics_2046978582/Timeseries-cross-product-query-returns-OK-response_1643865340/recording.har

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

examples/v2/metrics/QueryScalarData_3112571352.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const params: v2.MetricsApiQueryScalarDataRequest = {
2121
},
2222
},
2323
],
24-
from: 1671612804000,
24+
from: 1636625471000,
2525
queries: [
2626
{
2727
aggregator: "avg",
@@ -30,7 +30,7 @@ const params: v2.MetricsApiQueryScalarDataRequest = {
3030
name: "a",
3131
},
3232
],
33-
to: 1671620004000,
33+
to: 1636629071000,
3434
},
3535
type: "scalar_request",
3636
},

examples/v2/metrics/QueryTimeseriesData_301142940.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const params: v2.MetricsApiQueryTimeseriesDataRequest = {
2121
},
2222
},
2323
],
24-
from: 1671612804000,
24+
from: 1636625471000,
2525
interval: 5000,
2626
queries: [
2727
{
@@ -30,7 +30,7 @@ const params: v2.MetricsApiQueryTimeseriesDataRequest = {
3030
name: "a",
3131
},
3232
],
33-
to: 1671620004000,
33+
to: 1636629071000,
3434
},
3535
type: "timeseries_request",
3636
},

features/v2/metrics.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ Feature: Metrics
311311
Given a valid "appKeyAuth" key in the system
312312
And operation "QueryScalarData" enabled
313313
And new "QueryScalarData" request
314-
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": 1671612804000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": 1671620004000}, "type": "scalar_request"}}
314+
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": {{ timestamp('now - 1h') }}000, "queries": [{"aggregator": "avg", "data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": {{ timestamp('now') }}000}, "type": "scalar_request"}}
315315
When the request is sent
316316
Then the response status is 200 OK
317317
And the response "data.type" is equal to "scalar_response"
@@ -385,7 +385,7 @@ Feature: Metrics
385385
Given a valid "appKeyAuth" key in the system
386386
And operation "QueryTimeseriesData" enabled
387387
And new "QueryTimeseriesData" request
388-
And body with value {"data": {"attributes": {"formulas": [{"formula": "a", "limit": {"count": 10, "order": "desc"}}], "from": 1671612804000, "interval": 5000, "queries": [{"data_source": "metrics", "query": "avg:system.cpu.user{*}", "name": "a"}], "to": 1671620004000}, "type": "timeseries_request"}}
388+
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"}}
389389
When the request is sent
390390
Then the response status is 200 OK
391391
And the response "data.type" is equal to "timeseries_response"

0 commit comments

Comments
 (0)