Introduce TSDB service (#31520)

* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
Arve Knudsen
2021-03-08 07:02:49 +01:00
committed by GitHub
co-authored by Erik Sundell Will Browne Torkel Ödegaard Will Browne Zoltán Bedi
parent c899bf3592
commit b79e61656a
203 changed files with 5269 additions and 4776 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/tsdb"
"github.com/grafana/grafana/pkg/plugins"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -19,7 +19,7 @@ func TestTestdataScenarios(t *testing.T) {
t.Run("random walk ", func(t *testing.T) {
t.Run("Should start at the requested value", func(t *testing.T) {
timeRange := tsdb.NewFakeTimeRange("5m", "now", time.Now())
timeRange := plugins.DataTimeRange{From: "5m", To: "now", Now: time.Now()}
model := simplejson.New()
model.Set("startValue", 1.234)
@@ -63,7 +63,7 @@ func TestTestdataScenarios(t *testing.T) {
t.Run("random walk table", func(t *testing.T) {
t.Run("Should return a table that looks like value/min/max", func(t *testing.T) {
timeRange := tsdb.NewFakeTimeRange("5m", "now", time.Now())
timeRange := plugins.DataTimeRange{From: "5m", To: "now", Now: time.Now()}
model := simplejson.New()
modelBytes, err := model.MarshalJSON()
@@ -117,7 +117,7 @@ func TestTestdataScenarios(t *testing.T) {
})
t.Run("Should return a table with some nil values", func(t *testing.T) {
timeRange := tsdb.NewFakeTimeRange("5m", "now", time.Now())
timeRange := plugins.DataTimeRange{From: "5m", To: "now", Now: time.Now()}
model := simplejson.New()
model.Set("withNil", true)