collect

package
v0.0.0-...-b99510a Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessMetrics

func ProcessMetrics(prometheusAPI v1.API, metric string, metricObjects []metrics.MetricObject, dataDir string, timePeriod int, log *zap.Logger, inputOptions ...Option) error

ProcessMetrics queries the Prometheus API with the given metric object and outputs the returned data into CSV files prometheusAPI: the Prometheus client used to make API calls with metric: the current metric group being processed dataDir: the name of the directory that the CSV files will be written to timePeriod: the time, in minutes, to look back, starting from the current time, for the Prometheus query

Types

type Option

type Option func(*Options)

func WithStep

func WithStep(step time.Duration) Option

WithStep sets the step size. This is mainly useful for testing queries with differing step sizes, and to provide the option for specific metrics to use a different step size than the default

type Options

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

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns the default options

func (*Options) Step

func (o *Options) Step() time.Duration

Step returns the step size

Jump to

Keyboard shortcuts

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