prometheus

package
v0.0.0-...-ded32d3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 Provider

type Provider interface {
	// GetClusterHistory(string)
	GetHistoryMetrics(name, history string) (map[model.AggregateStateKey]*model.AggregateContainerState, error)

	GetTimeframeMetrics(name, historyLen, offset string) (map[model.AggregateStateKey]*model.AggregateContainerState, error)
}

Provider gives metrics data of all pods in a cluster. Consider refactoring to passing ClusterState and create history provider working with checkpoints.

func NewPrometheusHistoryProvider

func NewPrometheusHistoryProvider(prometheusAddress string) Provider

NewPrometheusHistoryProvider contructs a history provider that gets data from Prometheus.

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
	Sample 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