feat(testdata): lots of work on new test data data source and scenarios

This commit is contained in:
Torkel Ödegaard
2016-09-27 18:17:39 +02:00
parent ade8aa5b92
commit 3ecd96e682
16 changed files with 257 additions and 123 deletions

View File

@@ -4,7 +4,6 @@ import "github.com/grafana/grafana/pkg/components/simplejson"
type Query struct {
RefId string
Query string
Model *simplejson.Json
Depends []string
DataSource *DataSourceInfo
@@ -17,13 +16,13 @@ type Query struct {
type QuerySlice []*Query
type Request struct {
TimeRange TimeRange
TimeRange *TimeRange
Queries QuerySlice
}
type Response struct {
BatchTimings []*BatchTiming
Results map[string]*QueryResult
BatchTimings []*BatchTiming `json:"timings"`
Results map[string]*QueryResult `json:"results"`
}
type DataSourceInfo struct {
@@ -50,14 +49,14 @@ type BatchResult struct {
}
type QueryResult struct {
Error error
RefId string
Series TimeSeriesSlice
Error error `json:"error"`
RefId string `json:"refId"`
Series TimeSeriesSlice `json:"series"`
}
type TimeSeries struct {
Name string `json:"target"`
Points [][2]*float64 `json:"datapoints"`
Name string `json:"name"`
Points [][2]*float64 `json:"points"`
}
type TimeSeriesSlice []*TimeSeries