metrics

package
v0.0.0-...-055f8da Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0, MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Incr is equivalent to Count(bucket, 1).
	Incr(bucket string)

	// Decr is equivalent to Count(bucket, -1).
	Decr(bucket string)

	// Count increments the bucket by number.
	Count(bucket string, n int)

	// Gauge sends the absolute value of number to the given bucket.
	Gauge(bucket string, n int)

	// Timing marks the start of a duration measure.  It is used
	// to measure multiple durations from a single onset, t0.
	Timing(time.Time) Timing

	// Duration sends a time interval to the given bucket.
	// Precision is implementation-dependent, but usually
	// on the order of milliseconds.
	Duration(bucket string, d time.Duration)

	// Histogram sends an histogram value to a bucket.
	Histogram(bucket string, n int)

	// WithPrefix returns a new Metrics instance with 'prefix'
	// appended to the current prefix string, separated by '.'.
	WithPrefix(prefix string) Client

	// Flush writes all buffered metrics.
	Flush()
}

Client is the base interface for all metrics collection performed by CASM. Client are distinct from logs in that they are analyzed in aggregate, and are typically sampled to improve performance.

type NopClient

type NopClient struct{}

func (NopClient) Count

func (NopClient) Count(string, int)

func (NopClient) Decr

func (NopClient) Decr(string)

func (NopClient) Duration

func (NopClient) Duration(string, time.Duration)

func (NopClient) Flush

func (NopClient) Flush()

func (NopClient) Gauge

func (NopClient) Gauge(string, int)

func (NopClient) Histogram

func (NopClient) Histogram(string, int)

func (NopClient) Incr

func (NopClient) Incr(string)

func (NopClient) Timing

func (NopClient) Timing(t0 time.Time) Timing

func (NopClient) WithPrefix

func (NopClient) WithPrefix(string) Client

type Timing

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

func NewTiming

func NewTiming(c Client, t0 time.Time) Timing

func (Timing) Duration

func (t Timing) Duration() time.Duration

func (Timing) Send

func (t Timing) Send(bucket string)

Jump to

Keyboard shortcuts

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