custom-pod-autoscaler: Index | Files

package metric

import ""

Package metric provides functionality for managing gathering metrics, calling external metric gathering logic through shell commands with relevant data piped to them.


Package Files


type Gatherer Uses

type Gatherer struct {
    Clientset kubernetes.Interface
    Config    *config.Config
    Execute   execute.Executer

Gatherer handles triggering the metric gathering logic to gather metrics for a resource

func (*Gatherer) GetMetrics Uses

func (m *Gatherer) GetMetrics(spec Spec) ([]*Metric, error)

GetMetrics gathers metrics for the resource supplied

type GetMetricer Uses

type GetMetricer interface {
    GetMetrics(spec Spec) ([]*Metric, error)

GetMetricer provides methods for retrieving metrics

type Metric Uses

type Metric struct {
    Resource string `json:"resource,omitempty"`
    Value    string `json:"value,omitempty"`

Metric is the result of the custom metric calculation, containing information on the relevant resource and the metric value

type Spec Uses

type Spec struct {
    Resource metav1.Object `json:"resource"`
    Metrics  *[]*Metric    `json:"metrics,omitempty"`
    RunType  string        `json:"runType"`

Spec defines information fed into a gatherer to retrieve metrics, contains an optional field 'Metrics' for storing the result

Package metric imports 10 packages (graph) and is imported by 6 packages. Updated 2020-04-09. Refresh now. Tools for package owners.