Documentation ¶
Index ¶
- Constants
- func EpochPrecisionToMs(value float64) float64
- func FormatDuration(inter time.Duration) string
- func GetIntervalFrom(dsInfo *DataSource, queryModel *Query, defaultInterval time.Duration) (time.Duration, error)
- func NewIntervalCalculator(opt *IntervalOptions) *intervalCalculator
- func RegisterTsdbQueryEndpoint(dataSourceType string, fn GetTsdbQueryEndpointFn)
- type DataSource
- type GetTsdbQueryEndpointFn
- type HandleRequestFunc
- type Interval
- type IntervalCalculator
- type IntervalOptions
- type Query
- type QueryResult
- type QueryResultMeta
- type Response
- type RowValues
- type Table
- type TableColumn
- type TimePoint
- 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 TimeSeries
- type TimeSeriesPoints
- type TimeSeriesSlice
- type TsdbQuery
- type TsdbQueryEndpoint
Constants ¶
View Source
const (
ErrorNotFoundExecutorDataSource = errors.Error("Not find executor for data source")
)
Variables ¶
This section is empty.
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 GetIntervalFrom ¶
func NewIntervalCalculator ¶
func NewIntervalCalculator(opt *IntervalOptions) *intervalCalculator
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 QueryResultMeta `json:"meta"` Series TimeSeriesSlice `json:"series"` Tables []*Table `json:"tables"` Dataframes [][]byte `json:"dataframes"` }
func NewQueryResult ¶
func NewQueryResult() *QueryResult
type QueryResultMeta ¶
type QueryResultMeta struct {
RawQuery string `json:"raw_query"`
}
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 TimePoint ¶
type TimePoint []interface{}
func NewTimePoint ¶
func NewTimePointByVal ¶
func (TimePoint) PointValueStr ¶
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 TimeSeries ¶
type TimeSeries struct { RawName string `json:"raw_name"` Columns []string `json:"columns"` 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
type TsdbQueryEndpoint ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.