mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
This reverts commit 61a3160c34.
This commit is contained in:
@@ -308,20 +308,12 @@ func (c *baseClientImpl) createMultiSearchRequests(searchRequests []*SearchReque
|
||||
}
|
||||
|
||||
func (c *baseClientImpl) getMultiSearchQueryParameters() string {
|
||||
var qs []string
|
||||
|
||||
if c.version >= 70 {
|
||||
maxConcurrentShardRequests := c.getSettings().Get("maxConcurrentShardRequests").MustInt(5)
|
||||
qs = append(qs, fmt.Sprintf("max_concurrent_shard_requests=%d", maxConcurrentShardRequests))
|
||||
|
||||
includeFrozen := c.getSettings().Get("includeFrozen").MustBool(false)
|
||||
|
||||
if includeFrozen {
|
||||
qs = append(qs, "ignore_throttled=false")
|
||||
}
|
||||
return fmt.Sprintf("max_concurrent_shard_requests=%d", maxConcurrentShardRequests)
|
||||
}
|
||||
|
||||
return strings.Join(qs, "&")
|
||||
return ""
|
||||
}
|
||||
|
||||
func (c *baseClientImpl) MultiSearch() *MultiSearchRequestBuilder {
|
||||
|
||||
@@ -250,7 +250,6 @@ func TestClient(t *testing.T) {
|
||||
"maxConcurrentShardRequests": 100,
|
||||
"timeField": "@timestamp",
|
||||
"interval": "Daily",
|
||||
"includeFrozen": true,
|
||||
}),
|
||||
}, func(sc *scenarioContext) {
|
||||
sc.responseBody = `{
|
||||
@@ -272,7 +271,6 @@ func TestClient(t *testing.T) {
|
||||
So(sc.request, ShouldNotBeNil)
|
||||
So(sc.request.Method, ShouldEqual, http.MethodPost)
|
||||
So(sc.request.URL.Path, ShouldEqual, "/_msearch")
|
||||
So(sc.request.URL.RawQuery, ShouldNotContainSubstring, "ignore_throttled=")
|
||||
|
||||
So(sc.requestBody, ShouldNotBeNil)
|
||||
|
||||
@@ -314,7 +312,6 @@ func TestClient(t *testing.T) {
|
||||
"maxConcurrentShardRequests": 6,
|
||||
"timeField": "@timestamp",
|
||||
"interval": "Daily",
|
||||
"includeFrozen": true,
|
||||
}),
|
||||
}, func(sc *scenarioContext) {
|
||||
sc.responseBody = `{
|
||||
@@ -336,8 +333,7 @@ func TestClient(t *testing.T) {
|
||||
So(sc.request, ShouldNotBeNil)
|
||||
So(sc.request.Method, ShouldEqual, http.MethodPost)
|
||||
So(sc.request.URL.Path, ShouldEqual, "/_msearch")
|
||||
So(sc.request.URL.RawQuery, ShouldContainSubstring, "max_concurrent_shard_requests=6")
|
||||
So(sc.request.URL.RawQuery, ShouldContainSubstring, "ignore_throttled=false")
|
||||
So(sc.request.URL.RawQuery, ShouldEqual, "max_concurrent_shard_requests=6")
|
||||
|
||||
So(sc.requestBody, ShouldNotBeNil)
|
||||
|
||||
@@ -354,7 +350,6 @@ func TestClient(t *testing.T) {
|
||||
So(jHeader.Get("index").MustString(), ShouldEqual, "metrics-2018.05.15")
|
||||
So(jHeader.Get("ignore_unavailable").MustBool(false), ShouldEqual, true)
|
||||
So(jHeader.Get("search_type").MustString(), ShouldEqual, "query_then_fetch")
|
||||
So(jHeader.Get("ignore_throttled").MustBool(), ShouldBeFalse)
|
||||
|
||||
Convey("and replace $__interval variable", func() {
|
||||
So(jBody.GetPath("aggs", "2", "aggs", "1", "avg", "script").MustString(), ShouldEqual, "15000*@hostname")
|
||||
|
||||
Reference in New Issue
Block a user