metric

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 10 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
}

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

func (*Gatherer) GetMetrics

func (m *Gatherer) GetMetrics(resource metav1.Object) (*ResourceMetrics, error)

GetMetrics gathers metrics for the resource supplied

type GetMetricer added in v0.9.0

type GetMetricer interface {
	GetMetrics(resource metav1.Object) (*ResourceMetrics, 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 ResourceMetrics

type ResourceMetrics struct {
	ResourceName string        `json:"resource"`
	RunType      string        `json:"run_type"`
	Metrics      []*Metric     `json:"metrics"`
	Resource     metav1.Object `json:"-"` // hide
}

ResourceMetrics represents a resource's metrics, including each resource's metrics

Jump to

Keyboard shortcuts

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