Documentation
¶
Index ¶
- Constants
- type AlgorithmModelConfig
- type Broadcaster
- type Config
- type MetricContext
- func (c *MetricContext) ConvertApiMetric2InternalConfig(metric *v1alpha1.PredictionMetric) *Config
- func (c *MetricContext) ConvertApiMetrics2InternalConfigs(metrics []v1alpha1.PredictionMetric) []*Config
- func (c *MetricContext) DeleteApiConfig(conf *v1alpha1.PredictionMetric)
- func (c *MetricContext) DeleteApiConfigs(configs []v1alpha1.PredictionMetric)
- func (c *MetricContext) DeleteConfig(conf *Config)
- func (c *MetricContext) ResourceToPromQueryExpr(resourceName *corev1.ResourceName) string
- func (c *MetricContext) WithApiConfig(conf *v1alpha1.PredictionMetric)
- func (c *MetricContext) WithApiConfigs(configs []v1alpha1.PredictionMetric)
- func (c *MetricContext) WithConfig(conf *Config)
- func (c *MetricContext) WithConfigs(configs []*Config)
- type Receiver
Constants ¶
View Source
const ( // WorkloadCpuUsagePromQLFmtStr is used to query workload cpu usage by promql, param is namespace,workload-name,duration str WorkloadCpuUsagePromQLFmtStr = `sum (irate (container_cpu_usage_seconds_total{container!="",image!="",container!="POD",namespace="%s",pod=~"^%s-.*$"}[%s]))` // WorkloadMemUsagePromQLFmtStr is used to query workload mem usage by promql, param is namespace, workload-name WorkloadMemUsagePromQLFmtStr = `sum(container_memory_working_set_bytes{container!="",image!="",container!="POD",namespace="%s",pod=~"^%s-.*$"})` // following is node exporter metric for node cpu/memory usage // NodeCpuUsagePromQLFmtStr is used to query node cpu usage by promql, param is node name which prometheus scrape, duration str NodeCpuUsagePromQLFmtStr = `` /* 150-byte string literal not displayed */ // NodeMemUsagePromQLFmtStr is used to query node cpu memory by promql, param is node name, node name which prometheus scrape NodeMemUsagePromQLFmtStr = `sum(node_memory_MemTotal_bytes{instance=~"^%s.*"} - node_memory_MemAvailable_bytes{instance=~"^%s.*"})` )
View Source
const TargetKindNode = "Node"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgorithmModelConfig ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
var DeleteEventBroadcaster Broadcaster = NewBroadcaster()
var UpdateEventBroadcaster Broadcaster = NewBroadcaster()
func NewBroadcaster ¶
func NewBroadcaster() Broadcaster
func (Broadcaster) Listen ¶
func (b Broadcaster) Listen() Receiver
Listen starts listening to the broadcasts.
func (Broadcaster) Write ¶
func (b Broadcaster) Write(v interface{})
Write broadcasts a value to all listeners.
type Config ¶
type Config struct {
Metric *v1alpha1.MetricQuery
Expression *v1alpha1.ExpressionQuery
DSP *v1alpha1.DSP
Percentile *v1alpha1.Percentile
}
type MetricContext ¶
func (*MetricContext) ConvertApiMetric2InternalConfig ¶
func (c *MetricContext) ConvertApiMetric2InternalConfig(metric *v1alpha1.PredictionMetric) *Config
ConvertApiMetric2InternalConfig
func (*MetricContext) ConvertApiMetrics2InternalConfigs ¶
func (c *MetricContext) ConvertApiMetrics2InternalConfigs(metrics []v1alpha1.PredictionMetric) []*Config
ConvertApiMetrics2InternalConfigs
func (*MetricContext) DeleteApiConfig ¶
func (c *MetricContext) DeleteApiConfig(conf *v1alpha1.PredictionMetric)
func (*MetricContext) DeleteApiConfigs ¶
func (c *MetricContext) DeleteApiConfigs(configs []v1alpha1.PredictionMetric)
func (*MetricContext) DeleteConfig ¶
func (c *MetricContext) DeleteConfig(conf *Config)
func (*MetricContext) ResourceToPromQueryExpr ¶
func (c *MetricContext) ResourceToPromQueryExpr(resourceName *corev1.ResourceName) string
func (*MetricContext) WithApiConfig ¶
func (c *MetricContext) WithApiConfig(conf *v1alpha1.PredictionMetric)
func (*MetricContext) WithApiConfigs ¶
func (c *MetricContext) WithApiConfigs(configs []v1alpha1.PredictionMetric)
func (*MetricContext) WithConfig ¶
func (c *MetricContext) WithConfig(conf *Config)
func (*MetricContext) WithConfigs ¶
func (c *MetricContext) WithConfigs(configs []*Config)
Click to show internal directories.
Click to hide internal directories.