Documentation ¶
Index ¶
- Constants
- Variables
- type ClientAuth
- type DataSourceType
- type GrpcConfig
- type History
- type HistoryDataProxy
- func (h *HistoryDataProxy) DeleteHistoryProvider(name DataSourceType)
- func (h *HistoryDataProxy) QueryTimeSeries(metricNamer metricnaming.MetricNamer, startTime time.Time, endTime time.Time, ...) ([]*common.TimeSeries, error)
- func (h *HistoryDataProxy) RegisterHistoryProvider(name DataSourceType, provider History)
- type Interface
- type MockConfig
- type PromConfig
- type RealTime
- type RealTimeDataProxy
Constants ¶
const ( MockDataSource DataSourceType = "mock" PrometheusDataSource DataSourceType = "prom" MetricServerDataSource DataSourceType = "metricserver" GrpcDataSource DataSourceType = "grpc" DataSourceTypeKey string = "data-source-type" )
Variables ¶
var GrpcConfigKeys = []string{"grpc-ds-address", "grpc-ds-timeout"}
var PrometheusConfigKeys = []string{"prometheus-address", "prometheus-auth-username", "prometheus-auth-password",
"prometheus-auth-bearertoken", "prometheus-query-concurrency", "prometheus-insecure-skip-verify",
"prometheus-keepalive", "prometheus-timeout", "prometheus-bratelimit", "prometheus-maxpoints"}
Functions ¶
This section is empty.
Types ¶
type ClientAuth ¶
ClientAuth holds the HTTP client identity info.
func (*ClientAuth) Apply ¶
func (auth *ClientAuth) Apply(req *http.Request)
Apply applies the authentication identity info to the HTTP request headers
type DataSourceType ¶ added in v0.3.0
type DataSourceType string
type GrpcConfig ¶ added in v0.6.0
type History ¶ added in v0.3.0
type History interface { // QueryTimeSeries returns the time series that meet thw given metricNamer. QueryTimeSeries(metricNamer metricnaming.MetricNamer, startTime time.Time, endTime time.Time, step time.Duration) ([]*common.TimeSeries, error) }
History is a data source can provides history time series data at any time periods.
type HistoryDataProxy ¶ added in v0.3.0
func NewHistoryDataProxy ¶ added in v0.3.0
func NewHistoryDataProxy(historyProviders map[DataSourceType]History) *HistoryDataProxy
NewHistoryDataProxy return a proxy for all history providers, now it has no selecting policy configurable. Default policy is traversing all providers one by one until no error return.
func (*HistoryDataProxy) DeleteHistoryProvider ¶ added in v0.3.0
func (h *HistoryDataProxy) DeleteHistoryProvider(name DataSourceType)
func (*HistoryDataProxy) QueryTimeSeries ¶ added in v0.3.0
func (h *HistoryDataProxy) QueryTimeSeries(metricNamer metricnaming.MetricNamer, startTime time.Time, endTime time.Time, step time.Duration) ([]*common.TimeSeries, error)
func (*HistoryDataProxy) RegisterHistoryProvider ¶ added in v0.3.0
func (h *HistoryDataProxy) RegisterHistoryProvider(name DataSourceType, provider History)
type Interface ¶
Interface is a source of monitoring metric that provides metrics that can be used for prediction, such as 'cpu usage', 'memory footprint', 'request per second (qps)', etc.
type MockConfig ¶
type MockConfig struct {
SeedFile string
}
MockConfig represents the config of an in-memory provider, which is for demonstration or testing purpose.
type PromConfig ¶
type PromConfig struct { Address string Timeout time.Duration KeepAlive time.Duration InsecureSkipVerify bool Auth ClientAuth QueryConcurrency int BRateLimit bool MaxPointsLimitPerTimeSeries int }
PromConfig represents the config of prometheus
type RealTime ¶ added in v0.3.0
type RealTime interface { // QueryLatestTimeSeries returns the latest metric values that meet the given metricNamer. QueryLatestTimeSeries(metricNamer metricnaming.MetricNamer) ([]*common.TimeSeries, error) }
RealTime is a source of monitoring metric that provides data that is streamed data in current time.
type RealTimeDataProxy ¶ added in v0.3.0
func NewRealTimeDataProxy ¶ added in v0.3.0
func NewRealTimeDataProxy(realtimeProviders map[DataSourceType]RealTime) *RealTimeDataProxy
NewRealTimeDataProxy returns a proxy for all realtime providers, now it has no selecting policy configurable. Default policy is traversing all providers one by one until no error return.
func (*RealTimeDataProxy) DeleteRealTimeProvider ¶ added in v0.3.0
func (r *RealTimeDataProxy) DeleteRealTimeProvider(name DataSourceType)
func (*RealTimeDataProxy) QueryLatestTimeSeries ¶ added in v0.3.0
func (r *RealTimeDataProxy) QueryLatestTimeSeries(metricNamer metricnaming.MetricNamer) ([]*common.TimeSeries, error)
func (*RealTimeDataProxy) RegisterRealTimeProvider ¶ added in v0.3.0
func (r *RealTimeDataProxy) RegisterRealTimeProvider(name DataSourceType, provider RealTime)