metricsbatch

package
v0.0.0-...-d3ce8bf Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricsFetchBatch

func MetricsFetchBatch(
	ctx context.Context,
	ctr *app.Container,
	conf MetricsBatchConfig,
	rowConf io.Reader,
	testType string,
	outputRoot string,
) error

Types

type BatchConfigWithRawMetrics

type BatchConfigWithRawMetrics struct {
	Metrics MetricsBatchRawConfig `yaml:"metrics"`
}

type MetricsBatchConfig

type MetricsBatchConfig struct {
	Enabled  bool                        `yaml:"enabled"`
	Requests []MetricsBatchRequestConfig `yaml:"requests"`
}

type MetricsBatchRawConfig

type MetricsBatchRawConfig struct {
	Enabled  bool  `yaml:"enabled"`
	Requests []any `yaml:"requests"`
}

type MetricsBatchRequestConfig

type MetricsBatchRequestConfig struct {
	ID   string                          `yaml:"id"`
	Type string                          `yaml:"type"`
	Data []MetricsBatchRequestDataConfig `yaml:"data"`
}

type MetricsBatchRequestDataConfig

type MetricsBatchRequestDataConfig struct {
	Key      string `yaml:"key"`
	JMESPath string `yaml:"jmesPath"`
	OnNil    string `yaml:"onNil"`
}

type MetricsFetcher

type MetricsFetcher interface {
	Fetch(ctx context.Context, ctr *app.Container, writer MetricsWriter) (<-chan TermType, error)
}

type MetricsFetcherFactory

type MetricsFetcherFactory interface {
	Init(conf []byte) error
	FetcherFactory(ctx context.Context, ctr *app.Container) (MetricsFetcher, error)
}

func GetMetricsFetcherFactory

func GetMetricsFetcherFactory(t MetricsType) MetricsFetcherFactory

type MetricsThreadExecutor

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

type MetricsType

type MetricsType string
const (
	MetricsTypePrometheus MetricsType = "prometheus"
)

func NewMetricsTypeFromStr

func NewMetricsTypeFromStr(s string) MetricsType

type MetricsWriter

type MetricsWriter func(
	ctx context.Context,
	ctr *app.Container,
	data executor.ResponseContent[any],
) error

type PrometheusMetricsBatchRequestConfig

type PrometheusMetricsBatchRequestConfig struct {
	ID       string                          `yaml:"id"`
	Type     string                          `yaml:"type"`
	URL      string                          `yaml:"url"`
	Query    string                          `yaml:"query"`
	Interval string                          `yaml:"interval"`
	Data     []MetricsBatchRequestDataConfig `yaml:"data"`
}

func (*PrometheusMetricsBatchRequestConfig) FetcherFactory

func (*PrometheusMetricsBatchRequestConfig) Init

type PrometheusMetricsFetcher

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

func (PrometheusMetricsFetcher) CreateRequest

func (r PrometheusMetricsFetcher) CreateRequest(ctx context.Context, ctr *app.Container) (*http.Request, error)

func (*PrometheusMetricsFetcher) Fetch

func (p *PrometheusMetricsFetcher) Fetch(
	ctx context.Context,
	ctr *app.Container,
	writer MetricsWriter,
) (<-chan TermType, error)

type TermType

type TermType int
const (
	TermTypeContext TermType
	TermWriteError
)

Jump to

Keyboard shortcuts

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