metric

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gatherer

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

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

func (*Gatherer) GetMetrics

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

GetMetrics gathers metrics for the resource supplied

type GetMetricer added in v0.9.0

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

GetMetricer provides methods for retrieving metrics

type Metric

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 added in v0.11.0

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL