elastic: add more backend tests (#59312)

* elastic: added backend snapshot tests

* linter fixes
This commit is contained in:
Gábor Farkas
2022-11-28 14:59:57 +01:00
committed by GitHub
parent a7b2943dd1
commit f1dfaa784a
20 changed files with 1818 additions and 3 deletions

View File

@@ -0,0 +1,52 @@
[
{
"alias": "",
"bucketAggs": [
{
"field": "label",
"id": "4",
"settings": {
"min_doc_count": "1",
"order": "desc",
"orderBy": "_term",
"size": "10"
},
"type": "terms"
},
{
"field": "testtime",
"id": "2",
"settings": {
"interval": "1m",
"min_doc_count": "0",
"timeZone": "utc",
"trimEdges": "0"
},
"type": "date_histogram"
}
],
"datasource": {
"uid": "haha",
"type": "elasticsearch"
},
"datasourceId": 42,
"hide": true,
"metrics": [
{
"field": "float",
"id": "1",
"type": "max"
},
{
"field": "float",
"id": "3",
"type": "min"
}
],
"query": "",
"refId": "a",
"timeField": "testtime",
"intervalMs": 200,
"maxDataPoints": 779
}
]

View File

@@ -0,0 +1,53 @@
{
"aggs": {
"4": {
"aggs": {
"2": {
"aggs": {
"1": {
"max": {
"field": "float"
}
},
"3": {
"min": {
"field": "float"
}
}
},
"date_histogram": {
"extended_bounds": {
"max": 1668422625668,
"min": 1668422437218
},
"field": "testtime",
"fixed_interval": "1m",
"format": "epoch_millis",
"min_doc_count": 0
}
}
},
"terms": {
"field": "label",
"order": {
"_key": "desc"
},
"size": 10
}
}
},
"query": {
"bool": {
"filter": {
"range": {
"testtime": {
"format": "epoch_millis",
"gte": 1668422437218,
"lte": 1668422625668
}
}
}
}
},
"size": 0
}

View File

@@ -0,0 +1,41 @@
[
{
"refId": "a",
"datasource": { "uid": "haha", "type": "elasticsearch" },
"datasourceId": 42,
"query": "",
"alias": "",
"metrics": [{ "id": "1", "type": "max", "field": "float" }],
"bucketAggs": [
{
"type": "date_histogram",
"id": "2",
"settings": { "interval": "auto" },
"field": "testtime"
}
],
"timeField": "testtime",
"intervalMs": 30000,
"maxDataPoints": 814
},
{
"datasource": { "uid": "haha", "type": "elasticsearch" },
"datasourceId": 42,
"refId": "b",
"hide": false,
"query": "",
"alias": "",
"metrics": [{ "id": "1", "type": "min", "field": "float" }],
"bucketAggs": [
{
"type": "date_histogram",
"id": "2",
"settings": { "interval": "auto" },
"field": "testtime"
}
],
"timeField": "testtime",
"intervalMs": 30000,
"maxDataPoints": 814
}
]

View File

@@ -0,0 +1,37 @@
{
"size": 0,
"query": {
"bool": {
"filter": {
"range": {
"testtime": {
"gte": 1668422437218,
"lte": 1668422625668,
"format": "epoch_millis"
}
}
}
}
},
"aggs": {
"2": {
"date_histogram": {
"field": "testtime",
"min_doc_count": 0,
"extended_bounds": {
"min": 1668422437218,
"max": 1668422625668
},
"format": "epoch_millis",
"fixed_interval": "1000ms"
},
"aggs": {
"1": {
"max": {
"field": "float"
}
}
}
}
}
}

View File

@@ -0,0 +1,37 @@
{
"size": 0,
"query": {
"bool": {
"filter": {
"range": {
"testtime": {
"gte": 1668422437218,
"lte": 1668422625668,
"format": "epoch_millis"
}
}
}
}
},
"aggs": {
"2": {
"date_histogram": {
"field": "testtime",
"min_doc_count": 0,
"extended_bounds": {
"min": 1668422437218,
"max": 1668422625668
},
"format": "epoch_millis",
"fixed_interval": "1000ms"
},
"aggs": {
"1": {
"min": {
"field": "float"
}
}
}
}
}
}

View File

@@ -0,0 +1,45 @@
[
{
"alias": "",
"bucketAggs": [
{
"field": "label",
"id": "3",
"settings": {
"min_doc_count": "1",
"order": "desc",
"orderBy": "_term",
"size": "10"
},
"type": "terms"
},
{
"field": "testtime",
"id": "2",
"settings": {
"interval": "1m"
},
"type": "date_histogram"
}
],
"datasource": {
"type": "elasticsearch",
"uid": "haha"
},
"datasourceId": 42,
"expression": "",
"hide": true,
"intervalMs": 200,
"maxDataPoints": 1248,
"metrics": [
{
"id": "1",
"type": "count"
}
],
"query": "",
"refId": "a",
"timeField": "testtime",
"window": ""
}
]

View File

@@ -0,0 +1,43 @@
{
"aggs": {
"3": {
"aggs": {
"2": {
"date_histogram": {
"extended_bounds": {
"max": 1668422625668,
"min": 1668422437218
},
"field": "testtime",
"fixed_interval": "1m",
"format": "epoch_millis",
"min_doc_count": 0
}
}
},
"terms": {
"field": "label",
"order": {
"_key": "desc"
},
"size": 10
}
}
},
"query": {
"bool": {
"filter": {
"range": {
"testtime": {
"format": "epoch_millis",
"gte": 1668422437218,
"lte": 1668422625668
}
}
}
}
},
"size": 0
}