prometheus

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEdgeTraffifMetricsList

func GetEdgeTraffifMetricsList(ctx context.Context,
	obj *v1.ObjectReference,
	interval *metrics.Interval,
	details *mesh.ResourceDetails,
	queries map[string]string,
	client promv1.API,
	getEdge getEdgeFunc) (*metrics.TrafficMetricsList, error)

func GetResourceTrafficMetricsList

func GetResourceTrafficMetricsList(ctx context.Context,
	obj *v1.ObjectReference,
	interval *metrics.Interval,
	queries map[string]string,
	client promv1.API,
	getResource getResourceFunc) (*metrics.TrafficMetricsList, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(
	ctx context.Context,
	client promAPI.API,
	interval *metrics.Interval) *Client

func (*Client) Execute

func (c *Client) Execute(
	queryTemplate string, opts map[string]interface{}) (model.Vector, error)

func (*Client) Update

func (c *Client) Update(lst Lookup) error

type EdgeLookup

type EdgeLookup struct {
	Item *metrics.TrafficMetricsList

	Details mesh.ResourceDetails
	// contains filtered or unexported fields
}

func (*EdgeLookup) Get

func (e *EdgeLookup) Get(labels model.Metric) *metrics.TrafficMetrics

func (*EdgeLookup) Queries

func (e *EdgeLookup) Queries() []*Query

type Lookup

type Lookup interface {
	Get(edge model.Metric) *metrics.TrafficMetrics
	Queries() []*Query
}

type Queries

type Queries struct {
	ResourceQueries map[string]string `yaml:"resourceQueries"`
	EdgeQueries     map[string]string `yaml:"edgeQueries"`
}

type Query

type Query struct {
	Template string
	Name     string
	Values   map[string]interface{}
}

type ResourceLookup

type ResourceLookup struct {
	Item *metrics.TrafficMetricsList
	// contains filtered or unexported fields
}

func (*ResourceLookup) Get

func (*ResourceLookup) Queries

func (r *ResourceLookup) Queries() []*Query

Jump to

Keyboard shortcuts

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