metrics

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SimulateCounter added in v0.4.0

func SimulateCounter(mp *metric.MeterProvider, conf *Config, logger *zap.Logger)

Counter demonstrates how to measure non-decreasing int64s

func SimulateHistogram added in v0.4.0

func SimulateHistogram(mp *metric.MeterProvider, conf *Config, logger *zap.Logger)

Histogram demonstrates how to record a distribution of individual values

func SimulateUpDownCounter added in v0.4.0

func SimulateUpDownCounter(mp *metric.MeterProvider, conf *Config, logger *zap.Logger)

SimulateUpDownCounter demonstrates how to measure numbers that can go up and down

Types

type Config

type Config struct {
	WorkerCount   int
	NumMetrics    int
	Rate          int64
	TotalDuration time.Duration
	ServiceName   string

	// OTLP config
	Endpoint string
	Insecure bool
	UseHTTP  bool
	Headers  HeaderValue
}

type HeaderValue

type HeaderValue map[string]string

func (*HeaderValue) Set

func (v *HeaderValue) Set(s string) error

func (*HeaderValue) String

func (v *HeaderValue) String() string

type Worker added in v0.4.0

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

func NewWorker added in v0.4.0

func NewWorker(c *Config, logger *zap.Logger) *Worker

NewWorker creates a new worker

func (*Worker) Run added in v0.4.0

func (w *Worker) Run(ctx context.Context, workerFunc WorkerFunc) error

Run runs the worker

type WorkerFunc added in v0.4.0

type WorkerFunc func(ctx context.Context)

Jump to

Keyboard shortcuts

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