Documentation
¶
Index ¶
- func RegisterExecutor(pluginId string, fn GetExecutorFn)
- type Batch
- type BatchResult
- type BatchSlice
- type BatchTiming
- type Executor
- type GetExecutorFn
- type HandleRequestFunc
- type Interval
- type Query
- type QueryContext
- type QueryResult
- type QuerySlice
- type Request
- type Response
- type RowValues
- type Table
- type TableColumn
- type TimePoint
- type TimeRange
- type TimeSeries
- type TimeSeriesPoints
- type TimeSeriesSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterExecutor ¶
func RegisterExecutor(pluginId string, fn GetExecutorFn)
Types ¶
type BatchResult ¶
type BatchResult struct {
Error error
QueryResults map[string]*QueryResult
Timings *BatchTiming
}
func (*BatchResult) WithError ¶
func (br *BatchResult) WithError(err error) *BatchResult
type BatchSlice ¶
type BatchSlice []*Batch
type BatchTiming ¶
type BatchTiming struct {
TimeElapsed int64
}
type Executor ¶
type Executor interface {
Execute(ctx context.Context, queries QuerySlice, query *QueryContext) *BatchResult
}
type GetExecutorFn ¶
type GetExecutorFn func(dsInfo *models.DataSource) (Executor, error)
type HandleRequestFunc ¶
type Interval ¶
func CalculateInterval ¶
type Query ¶
type Query struct {
RefId string
Model *simplejson.Json
Depends []string
DataSource *models.DataSource
Results []*TimeSeries
Exclude bool
MaxDataPoints int64
IntervalMs int64
}
type QueryContext ¶
type QueryContext struct {
TimeRange *TimeRange
Queries QuerySlice
Results map[string]*QueryResult
ResultsChan chan *BatchResult
Lock sync.RWMutex
BatchWaits sync.WaitGroup
}
func NewQueryContext ¶
func NewQueryContext(queries QuerySlice, timeRange *TimeRange) *QueryContext
type QueryResult ¶
type QueryResult struct {
Error error `json:"-"`
ErrorString string `json:"error,omitempty"`
RefId string `json:"refId"`
Meta *simplejson.Json `json:"meta,omitempty"`
Series TimeSeriesSlice `json:"series"`
Tables []*Table `json:"tables"`
}
func NewQueryResult ¶
func NewQueryResult() *QueryResult
type QuerySlice ¶
type QuerySlice []*Query
type Request ¶
type Request struct {
TimeRange *TimeRange
Queries QuerySlice
}
type Response ¶
type Response struct {
BatchTimings []*BatchTiming `json:"timings"`
Results map[string]*QueryResult `json:"results"`
Message string `json:"message,omitempty"`
}
type Table ¶
type Table struct {
Columns []TableColumn `json:"columns"`
Rows []RowValues `json:"rows"`
}
type TableColumn ¶
type TableColumn struct {
Text string `json:"text"`
}
type TimeRange ¶
func NewTimeRange ¶
func (*TimeRange) GetFromAsMsEpoch ¶
func (*TimeRange) GetToAsMsEpoch ¶
func (*TimeRange) MustGetFrom ¶
type TimeSeries ¶
type TimeSeries struct {
Name string `json:"name"`
Points TimeSeriesPoints `json:"points"`
Tags map[string]string `json:"tags,omitempty"`
}
func NewTimeSeries ¶
func NewTimeSeries(name string, points TimeSeriesPoints) *TimeSeries
type TimeSeriesPoints ¶
type TimeSeriesPoints []TimePoint
func NewTimeSeriesPointsFromArgs ¶
func NewTimeSeriesPointsFromArgs(values ...float64) TimeSeriesPoints
type TimeSeriesSlice ¶
type TimeSeriesSlice []*TimeSeries
Source Files
¶
Click to show internal directories.
Click to hide internal directories.