history

package
v0.0.0-...-503a17f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryProvider

type HistoryProvider interface {
	GetClusterHistory() (map[model.PodID]*PodHistory, error)
}

HistoryProvider gives history of all pods in a cluster. TODO(schylek): this interface imposes how history is represented which doesn't work well with checkpoints. Consider refactoring to passing ClusterState and create history provider working with checkpoints.

func NewPrometheusHistoryProvider

func NewPrometheusHistoryProvider(prometheusAddress string) HistoryProvider

NewPrometheusHistoryProvider contructs a history provider that gets data from Prometheus.

type PodHistory

type PodHistory struct {
	// Current samples if pod is still alive, last known samples otherwise.
	LastLabels map[string]string
	LastSeen   time.Time
	// A map for container name to a list of its usage samples, in chronological
	// order.
	Samples map[string][]model.ContainerUsageSample
}

PodHistory represents history of usage and labels for a given pod.

type PrometheusClient

type PrometheusClient interface {
	// Given a particular query (that's supposed to return range vectors
	// in Prometheus terminology), gets the results from Prometheus.
	GetTimeseries(query string) ([]Timeseries, error)
}

PrometheusClient talks to Prometheus using its HTTP API.

func NewPrometheusClient

func NewPrometheusClient(httpClient httpGetter, address string) PrometheusClient

NewPrometheusClient constructs a prometheusClient.

type Sample

type Sample struct {
	Value     float64
	Timestamp time.Time
}

Sample is a single timestamped value of the metric.

type Timeseries

type Timeseries struct {
	Labels  map[string]string
	Samples []Sample
}

Timeseries represents a metric with given labels, with its values possibly changing in time.

Jump to

Keyboard shortcuts

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