prom

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterExporterEndpoints

func RegisterExporterEndpoints()

Types

type Client

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

func NewClient

func NewClient(cf *config.Config, lg *zap.Logger) *Client

func (*Client) GetCurrentMetricValue

func (c *Client) GetCurrentMetricValue(ctx context.Context, query string) ([]Metric, error)

func (*Client) GetMetricRangeData

func (c *Client) GetMetricRangeData(ctx context.Context, query string, start, end time.Time, chunkSize time.Duration) ([]Metric, error)

type Exporter

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

func NewExporter

func NewExporter(cf *config.Config, lg *zap.Logger) Exporter

func (*Exporter) Shutdown

func (e *Exporter) Shutdown(ctx context.Context) func() error

func (*Exporter) Start

func (e *Exporter) Start(ctx context.Context) func() error

type Metric

type Metric struct {
	Name   string
	Labels map[string]string
	Values SamplePairs
	// contains filtered or unexported fields
}

func (*Metric) Append

func (m *Metric) Append(data Metric, rollingWindow time.Duration) error

func (*Metric) End

func (m *Metric) End() time.Time

func (*Metric) Equal

func (m *Metric) Equal(to Metric) bool

func (*Metric) Key

func (m *Metric) Key() string

func (*Metric) LabelNames

func (m *Metric) LabelNames() []string

func (*Metric) LabelValuesFor

func (m *Metric) LabelValuesFor(names []string) []string

func (*Metric) Start

func (m *Metric) Start() time.Time

type SamplePair

type SamplePair struct {
	Time  time.Time
	Value float64
}

func (SamplePair) IsZero

func (s SamplePair) IsZero() bool

type SamplePairs

type SamplePairs []SamplePair

func (SamplePairs) Nearest

func (s SamplePairs) Nearest(nearest time.Time) SamplePair

Jump to

Keyboard shortcuts

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