Documentation ¶
Index ¶
- type ClientAuth
- type ClientProfile
- type Credentials
- type DataSourceType
- type History
- type HistoryDataProxy
- func (h *HistoryDataProxy) DeleteHistoryProvider(name DataSourceType)
- func (h *HistoryDataProxy) QueryTimeSeries(ctx context.Context, metricNamer metricnaming.MetricNamer, startTime time.Time, ...) ([]*common.TimeSeries, error)
- func (h *HistoryDataProxy) RegisterHistoryProvider(name DataSourceType, provider History)
- type Interface
- type LabelConverter
- type MockConfig
- type PromConfig
- type QCloudMonitorConfig
- type RealTime
- type RealTimeDataProxy
- func (r *RealTimeDataProxy) DeleteRealTimeProvider(name DataSourceType)
- func (r *RealTimeDataProxy) QueryLatestTimeSeries(ctx context.Context, metricNamer metricnaming.MetricNamer) ([]*common.TimeSeries, error)
- func (r *RealTimeDataProxy) RegisterRealTimeProvider(name DataSourceType, provider RealTime)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 ClientProfile ¶
type Credentials ¶
Credentials use user defined SecretId and SecretKey
type DataSourceType ¶
type DataSourceType string
const ( MockDataSource DataSourceType = "mock" PrometheusDataSource DataSourceType = "prom" MetricServerDataSource DataSourceType = "metricserver" QCloudMonitorDataSource DataSourceType = "qcloudmonitor" )
type History ¶
type History interface { // QueryTimeSeries returns the time series that meet thw given metricNamer. QueryTimeSeries(ctx context.Context, 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 ¶
func NewHistoryDataProxy ¶
func NewHistoryDataProxy(historyProviders map[DataSourceType]History) *HistoryDataProxy
NewHistoryDataProxy return a proxy for all history datasource-providers, now it has no selecting policy configurable. Default policy is traversing all datasource-providers one by one until no error return.
func (*HistoryDataProxy) DeleteHistoryProvider ¶
func (h *HistoryDataProxy) DeleteHistoryProvider(name DataSourceType)
func (*HistoryDataProxy) QueryTimeSeries ¶
func (h *HistoryDataProxy) QueryTimeSeries(ctx context.Context, metricNamer metricnaming.MetricNamer, startTime time.Time, endTime time.Time, step time.Duration) ([]*common.TimeSeries, error)
func (*HistoryDataProxy) RegisterHistoryProvider ¶
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 LabelConverter ¶
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 FederatedClusterScope bool // for thanos query, it must when use thanos as query source https://thanos.io/tip/components/query.md/#partial-response ThanosPartial bool ThanosDedup bool }
PromConfig represents the config of prometheus
type QCloudMonitorConfig ¶
type QCloudMonitorConfig struct { Credentials `name:"credentials" value:"optional"` ClientProfile `name:"clientProfile" value:"optional"` }
type RealTime ¶
type RealTime interface { // QueryLatestTimeSeries returns the latest metric values that meet the given metricNamer. QueryLatestTimeSeries(ctx context.Context, 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 ¶
func NewRealTimeDataProxy ¶
func NewRealTimeDataProxy(realtimeProviders map[DataSourceType]RealTime) *RealTimeDataProxy
NewRealTimeDataProxy return a proxy for all realtime datasource-providers, now it has no selecting policy configurable. Default policy is traversing all datasource-providers one by one until no error return.
func (*RealTimeDataProxy) DeleteRealTimeProvider ¶
func (r *RealTimeDataProxy) DeleteRealTimeProvider(name DataSourceType)
func (*RealTimeDataProxy) QueryLatestTimeSeries ¶
func (r *RealTimeDataProxy) QueryLatestTimeSeries(ctx context.Context, metricNamer metricnaming.MetricNamer) ([]*common.TimeSeries, error)
func (*RealTimeDataProxy) RegisterRealTimeProvider ¶
func (r *RealTimeDataProxy) RegisterRealTimeProvider(name DataSourceType, provider RealTime)