metrics

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Int64Counter(name string, description string, unit Unit) Int64Counter
	Int64Gauge(name string, description string, unit Unit) Int64Gauge
	Int64Histogram(name string, description string, unit Unit) Int64Histogram
	WithTags(tags map[string]string) Handler
}

func NewNoOpHandler

func NewNoOpHandler(_ context.Context) Handler

func NewOtelHandler

func NewOtelHandler(_ context.Context, provider otelmetric.MeterProvider, name string) Handler

type Int64Counter

type Int64Counter interface {
	Add(ctx context.Context, value int64, tags map[string]string)
}

type Int64Gauge

type Int64Gauge interface {
	Observe(ctx context.Context, value int64, tags map[string]string)
}

type Int64Histogram

type Int64Histogram interface {
	Record(ctx context.Context, value int64, tags map[string]string)
}

type M

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

func New

func New(handler Handler) *M

func (*M) RecordTaskFailure

func (m *M) RecordTaskFailure(ctx context.Context, task tasks.TaskType, dur time.Duration)

func (*M) RecordTaskSuccess

func (m *M) RecordTaskSuccess(ctx context.Context, task tasks.TaskType, dur time.Duration)

type Unit

type Unit string
const (
	Dimensionless Unit = "1"
	Bytes         Unit = "By"
	Milliseconds  Unit = "ms"
)

Jump to

Keyboard shortcuts

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