Documentation ¶
Index ¶
- Variables
- func EpochPrecisionToMs(value float64) float64
- func FormatDuration(inter time.Duration) string
- func FormatRawName(idx int, name string, groupByTags []string, tags map[string]string, ...) string
- func GetIntervalFrom(dsInfo *DataSource, queryModel *Query, defaultInterval time.Duration) (time.Duration, error)
- func IsValidDataSource(dsType string) error
- func NewIntervalCalculator(opt *IntervalOptions) *intervalCalculator
- func NewTimeSeries(name string, rawName string, columns []string, points api.TimeSeriesPoints, ...) *api.TimeSeries
- func RegisterTsdbQueryEndpoint(dataSourceType string, fn GetTsdbQueryEndpointFn)
- func TryParseUnixMsEpoch(val string) (time.Time, bool)
- type DataSource
- type GetTsdbQueryEndpointFn
- type HandleRequestFunc
- type Interval
- type IntervalCalculator
- type IntervalOptions
- type Query
- type QueryResult
- type Response
- type RowValues
- type Table
- type TableColumn
- type TimeRange
- func (tr *TimeRange) GetFromAsMsEpoch() int64
- func (tr *TimeRange) GetFromAsSecondsEpoch() int64
- func (tr *TimeRange) GetFromAsTimeUTC() time.Time
- func (tr *TimeRange) GetToAsMsEpoch() int64
- func (tr *TimeRange) GetToAsSecondsEpoch() int64
- func (tr *TimeRange) GetToAsTimeUTC() time.Time
- func (tr *TimeRange) MustGetFrom() time.Time
- func (tr *TimeRange) MustGetTo() time.Time
- func (tr *TimeRange) ParseFrom() (time.Time, error)
- func (tr *TimeRange) ParseTo() (time.Time, error)
- type TsdbQuery
- type TsdbQueryEndpoint
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorNotFoundExecutorDataSource error = errors.Error("Not find executor for data source")
)
Functions ¶
func EpochPrecisionToMs ¶
EpochPrecisionToMs converts epoch precision to millisecond, if needed. Only seconds to milliseconds supported right now
func FormatDuration ¶
FormatDuration converts a duration into the kbn format e.g. 1m 2h or 3d
func FormatRawName ¶
func GetIntervalFrom ¶
func IsValidDataSource ¶
func NewIntervalCalculator ¶
func NewIntervalCalculator(opt *IntervalOptions) *intervalCalculator
func NewTimeSeries ¶
func NewTimeSeries( name string, rawName string, columns []string, points api.TimeSeriesPoints, tags map[string]string, ) *api.TimeSeries
func RegisterTsdbQueryEndpoint ¶
func RegisterTsdbQueryEndpoint(dataSourceType string, fn GetTsdbQueryEndpointFn)
Types ¶
type DataSource ¶
type DataSource struct { Id string Name string Type string Url string User string Password string Database string BasicAuth bool BasicAuthUser string BasicAuthPassword string TimeInterval string Updated time.Time }
func (*DataSource) GetHttpClient ¶
func (ds *DataSource) GetHttpClient() (*http.Client, error)
func (*DataSource) GetHttpTransport ¶
func (ds *DataSource) GetHttpTransport() (*dataSourceTransport, error)
func (*DataSource) GetTLSConfig ¶
func (ds *DataSource) GetTLSConfig() (*tls.Config, error)
type GetTsdbQueryEndpointFn ¶
type GetTsdbQueryEndpointFn func(dsInfo *DataSource) (TsdbQueryEndpoint, error)
type HandleRequestFunc ¶
type Interval ¶
func (*Interval) Milliseconds ¶
type IntervalCalculator ¶
type IntervalOptions ¶
type Query ¶
type Query struct { RefId string api.MetricQuery DataSource DataSource MaxDataPoints int64 IntervalMs int64 }
type QueryResult ¶
type QueryResult struct { Error error `json:"-"` ErrorString string `json:"error,omitempty"` RefId string `json:"ref_id"` Meta api.QueryResultMeta `json:"meta"` Series api.TimeSeriesSlice `json:"series"` Tables []*Table `json:"tables"` Dataframes [][]byte `json:"dataframes"` }
func NewQueryResult ¶
func NewQueryResult() *QueryResult
type Response ¶
type Response struct { Results map[string]*QueryResult `json:"results"` Message string `json:"message,omitempty"` }
func HandleRequest ¶
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) GetFromAsSecondsEpoch ¶
func (*TimeRange) GetFromAsTimeUTC ¶
func (*TimeRange) GetToAsMsEpoch ¶
func (*TimeRange) GetToAsSecondsEpoch ¶
func (*TimeRange) GetToAsTimeUTC ¶
func (*TimeRange) MustGetFrom ¶
type TsdbQueryEndpoint ¶
type TsdbQueryEndpoint interface { Query(ctx context.Context, ds *DataSource, query *TsdbQuery) (*Response, error) FilterMeasurement(ctx context.Context, ds *DataSource, from, to string, ms *monitor.InfluxMeasurement, tagFilter *monitor.MetricQueryTag) (*monitor.InfluxMeasurement, error) }
func GetTsdbQueryEndpointFor ¶
func GetTsdbQueryEndpointFor(dsInfo *DataSource) (TsdbQueryEndpoint, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.