TSDB: add deprecation comments to many tsdb structs (#33281)

This commit is contained in:
Ryan McKinley
2021-04-22 18:03:11 -07:00
committed by GitHub
parent aa5bdff97d
commit 7627b55ef4
44 changed files with 124 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ func init() {
}
// Query builds flux queries, executes them, and returns the results.
//nolint: staticcheck // plugins.DataQuery deprecated
func Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery plugins.DataQuery) (
plugins.DataResponse, error) {
glog.Debug("Received a query", "query", tsdbQuery)
@@ -98,6 +99,7 @@ func runnerFromDataSource(dsInfo *models.DataSource) (*runner, error) {
// backendDataResponseToDataResponse takes the SDK's style response and changes it into a
// plugins.DataQueryResult. This is a wrapper so less of existing code needs to be changed. This should
// be able to be removed in the near future https://github.com/grafana/grafana/pull/25472.
//nolint: staticcheck // plugins.DataQueryResult deprecated
func backendDataResponseToDataResponse(dr *backend.DataResponse, refID string) plugins.DataQueryResult {
qr := plugins.DataQueryResult{
RefID: refID,

View File

@@ -22,6 +22,7 @@ type Executor struct {
ResponseParser *ResponseParser
}
//nolint: staticcheck // plugins.DataPlugin deprecated
func NewExecutor(*models.DataSource) (plugins.DataPlugin, error) {
return &Executor{
QueryParser: &InfluxdbQueryParser{},
@@ -39,6 +40,7 @@ func init() {
glog = log.New("tsdb.influxdb")
}
//nolint: staticcheck // plugins.DataResponse deprecated
func (e *Executor) DataQuery(ctx context.Context, dsInfo *models.DataSource, tsdbQuery plugins.DataQuery) (
plugins.DataResponse, error) {
glog.Debug("Received a query request", "numQueries", len(tsdbQuery.Queries))

View File

@@ -23,6 +23,7 @@ func init() {
legendFormat = regexp.MustCompile(`\[\[([\@\/\w-]+)(\.[\@\/\w-]+)*\]\]*|\$\s*([\@\/\w-]+?)*`)
}
// nolint:staticcheck // plugins.DataQueryResult deprecated
func (rp *ResponseParser) Parse(buf io.ReadCloser, query *Query) plugins.DataQueryResult {
var queryRes plugins.DataQueryResult

View File

@@ -17,12 +17,14 @@ func prepare(text string) io.ReadCloser {
return ioutil.NopCloser(strings.NewReader(text))
}
// nolint:staticcheck // plugins.DataQueryResult deprecated
func decodedFrames(t *testing.T, result plugins.DataQueryResult) data.Frames {
decoded, err := result.Dataframes.Decoded()
require.NoError(t, err)
return decoded
}
// nolint:staticcheck // plugins.DataQueryResult deprecated
func assertSeriesName(t *testing.T, result plugins.DataQueryResult, index int, name string) {
decoded := decodedFrames(t, result)