From e8bb894a02c6a233eb21926323d94d8064e2e2c5 Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Thu, 23 Mar 2023 09:36:37 +0100 Subject: [PATCH] Elasticsearch: Remove GetMinInterval method that is not used anymore (#65203) --- pkg/tsdb/elasticsearch/client/client.go | 7 ------- pkg/tsdb/elasticsearch/data_query_test.go | 4 ---- 2 files changed, 11 deletions(-) diff --git a/pkg/tsdb/elasticsearch/client/client.go b/pkg/tsdb/elasticsearch/client/client.go index d0dde29463a..5c749b6b8f8 100644 --- a/pkg/tsdb/elasticsearch/client/client.go +++ b/pkg/tsdb/elasticsearch/client/client.go @@ -16,7 +16,6 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/tsdb/intervalv2" ) type DatasourceInfo struct { @@ -44,7 +43,6 @@ const loggerName = "tsdb.elasticsearch.client" // Client represents a client which can interact with elasticsearch api type Client interface { GetConfiguredFields() ConfiguredFields - GetMinInterval(queryInterval string) (time.Duration, error) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearchResponse, error) MultiSearch() *MultiSearchRequestBuilder } @@ -87,11 +85,6 @@ func (c *baseClientImpl) GetConfiguredFields() ConfiguredFields { return c.configuredFields } -func (c *baseClientImpl) GetMinInterval(queryInterval string) (time.Duration, error) { - timeInterval := c.ds.TimeInterval - return intervalv2.GetIntervalFrom(queryInterval, timeInterval, 0, 5*time.Second) -} - type multiRequest struct { header map[string]interface{} body interface{} diff --git a/pkg/tsdb/elasticsearch/data_query_test.go b/pkg/tsdb/elasticsearch/data_query_test.go index cf6e06fd8e2..d8afa640094 100644 --- a/pkg/tsdb/elasticsearch/data_query_test.go +++ b/pkg/tsdb/elasticsearch/data_query_test.go @@ -1712,10 +1712,6 @@ func (c *fakeClient) GetConfiguredFields() es.ConfiguredFields { return c.configuredFields } -func (c *fakeClient) GetMinInterval(queryInterval string) (time.Duration, error) { - return 15 * time.Second, nil -} - func (c *fakeClient) ExecuteMultisearch(r *es.MultiSearchRequest) (*es.MultiSearchResponse, error) { c.multisearchRequests = append(c.multisearchRequests, r) return c.multiSearchResponse, c.multiSearchError