metrics

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 16 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 SimulateExponentialHistogram added in v0.5.0

func SimulateExponentialHistogram(mp metric.MeterProvider, config ExponentialHistogramConfig, conf *Config, logger *zap.Logger)

func SimulateGauge added in v0.5.0

func SimulateGauge(mp metric.MeterProvider, gaugeConfig GaugeConfig, conf *Config, logger *zap.Logger)

func SimulateHistogram added in v0.4.0

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

func SimulateSum added in v0.5.0

func SimulateSum(mp metric.MeterProvider, sumConfig SumConfig, conf *Config, logger *zap.Logger)

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 Exemplar added in v0.5.0

type Exemplar struct {
	FilteredAttributes []attribute.KeyValue
	TimeUnix           int64
	Value              float64
	SpanID             trace.SpanID
	TraceID            trace.TraceID
}

type ExponentialHistogramConfig added in v0.5.0

type ExponentialHistogramConfig struct {
	Name          string
	Description   string
	Unit          string
	Attributes    []attribute.KeyValue
	Temporality   metricdata.Temporality
	Scale         int32
	MaxSize       float64
	RecordMinMax  bool
	ZeroThreshold float64
}

type ExponentialHistogramDataPoint added in v0.5.0

type ExponentialHistogramDataPoint struct {
	ID              string
	Attributes      []attribute.KeyValue
	StartTimeUnix   int64
	TimeUnix        int64
	Count           uint64
	Sum             float64
	Scale           int32
	ZeroCount       uint64
	PositiveBuckets map[int32]uint64
	NegativeBuckets map[int32]uint64
	Min             float64
	Max             float64
	Exemplars       []Exemplar
}

type GaugeConfig added in v0.5.0

type GaugeConfig struct {
	Name        string
	Description string
	Unit        string
	Attributes  []attribute.KeyValue
	Min         float64
	Max         float64
	Temporality metricdata.Temporality
}

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 HistogramConfig added in v0.5.0

type HistogramConfig struct {
	Name         string
	Description  string
	Unit         string
	Attributes   []attribute.KeyValue
	Temporality  metricdata.Temporality
	Bounds       []float64
	RecordMinMax bool
}

type HistogramDataPoint added in v0.5.0

type HistogramDataPoint struct {
	ID            string
	Attributes    []attribute.KeyValue
	StartTimeUnix int64
	TimeUnix      int64
	Count         uint64
	Sum           float64
	Min           float64
	Max           float64
	BucketCounts  []uint64
	Exemplars     []Exemplar
}

type SumConfig added in v0.5.0

type SumConfig struct {
	Name        string
	Description string
	Unit        string
	Attributes  []attribute.KeyValue
	Temporality metricdata.Temporality
	IsMonotonic bool
}

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