graphite

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderType indicates the provider is Graphite.
	ProviderType = "Graphite"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Query(query string) ([]dataPoint, error)
}

API represents a Graphite API client

type APIClient

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

APIClient is a Graphite API client

func NewAPIClient

func NewAPIClient(metric v1alpha1.Metric, logCTX log.Entry) (*APIClient, error)

NewAPIClient generates a APIClient from the metric configuration

func (APIClient) Query

func (api APIClient) Query(quer string) ([]dataPoint, error)

Query performs a Graphite API query with the query it's passed

type Provider

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

Provider contains the required components to run a Graphite query. TODO: add support for username/password authentication.

func NewGraphiteProvider

func NewGraphiteProvider(api API, logCtx log.Entry) *Provider

NewGraphiteProvider returns a new Graphite provider

func (*Provider) GarbageCollect

func (p *Provider) GarbageCollect(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric, limit int) error

GarbageCollect is a no-op for the Graphite provider

func (*Provider) GetMetadata added in v1.2.0

func (p *Provider) GetMetadata(metric v1alpha1.Metric) map[string]string

GetMetadata returns any additional metadata which needs to be stored & displayed as part of the metrics result.

func (*Provider) Resume

func (p *Provider) Resume(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement

Resume should not be used with the Graphite provider since all the work should occur in the Run method

func (*Provider) Run

Run queries Graphite for the metric.

func (*Provider) Terminate

func (p *Provider) Terminate(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement

Terminate should not be used with the Graphite provider since all the work should occur in the Run method

func (*Provider) Type

func (p *Provider) Type() string

Type indicates provider is a Graphite provider.

Jump to

Keyboard shortcuts

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