statsd

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

This file only wraps all the statsd client call to be used directly in the form of telemetry.Gauge() instead of telemetry.statsd.Gauge() It does NOT implement all the function from the statsd.ClientInterface interface because some of these are never going to be used in this application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func Count

func Count(ctx context.Context, name string, value int64, tags []string, rate float64) error

Count tracks how many times something happened per second.

func Decr

func Decr(ctx context.Context, name string, tags []string, rate float64) error

Decr is just Count of -1

func Distribution

func Distribution(ctx context.Context, name string, value float64, tags []string, rate float64) error

Distribution tracks accurate global percentiles of a set of values.

func Event

func Event(event *statsd.Event) error

Event sends the provided Event.

func Flush

func Flush() error

Flush flushes any pending stats in the statsd client.

func Gauge

func Gauge(ctx context.Context, name string, value float64, tags []string, rate float64) error

Gauge measures the value of a metric at a particular time.

func Histogram

func Histogram(ctx context.Context, name string, value float64, tags []string, rate float64) error

Histogram tracks the statistical distribution of a set of values.

func Incr

func Incr(ctx context.Context, name string, tags []string, rate float64) error

Incr is just Count of 1

func IsClosed

func IsClosed() bool

func Set

func Set(ctx context.Context, name string, value string, tags []string, rate float64) error

Set counts the number of unique elements in a group.

func Setup

func Setup(ctx context.Context, cfg *config.KubehoundConfig) error

func SimpleEvent

func SimpleEvent(title string, text string) error

SimpleEvent sends an event with the provided title and text.

func TimeInMilliseconds

func TimeInMilliseconds(ctx context.Context, name string, value float64, tags []string, rate float64) error

TimeInMilliseconds sends timing information in milliseconds.

func Timing

func Timing(ctx context.Context, name string, value time.Duration, tags []string, rate float64) error

Timing sends timing information, it is an alias for TimeInMilliseconds

func TimingDist

func TimingDist(ctx context.Context, name string, dt time.Duration, tags []string, rate float64) error

TimingDist sends dt in milliseconds as a distribution (p50-p99)

Types

type NoopClient

type NoopClient struct{}

NoopClient may be used in place of any type of statsd client that speaks statsd.ClientInterface for testing, to remove side-effects of statsd calls

func NewNoopClient

func NewNoopClient() *NoopClient

NewNoopClient returns a statsd client implementation that does nothing. It is used for tests.

func (*NoopClient) Close

func (*NoopClient) Close() error

func (*NoopClient) Count

func (*NoopClient) Count(name string, value int64, tags []string, rate float64) error

func (*NoopClient) CountWithTimestamp

func (*NoopClient) CountWithTimestamp(name string, value int64, tags []string, rate float64, timestamp time.Time) error

func (*NoopClient) Decr

func (*NoopClient) Decr(name string, tags []string, rate float64) error

func (*NoopClient) Distribution

func (*NoopClient) Distribution(name string, value float64, tags []string, rate float64) error

func (*NoopClient) Event

func (*NoopClient) Event(event *statsd.Event) error

func (*NoopClient) Flush

func (*NoopClient) Flush() error

func (*NoopClient) Gauge

func (*NoopClient) Gauge(name string, value float64, tags []string, rate float64) error

func (*NoopClient) GaugeWithTimestamp

func (*NoopClient) GaugeWithTimestamp(name string, value float64, tags []string, rate float64, timestamp time.Time) error

func (*NoopClient) GetTelemetry

func (*NoopClient) GetTelemetry() statsd.Telemetry

func (*NoopClient) Histogram

func (*NoopClient) Histogram(name string, value float64, tags []string, rate float64) error

func (*NoopClient) Incr

func (*NoopClient) Incr(name string, tags []string, rate float64) error

func (*NoopClient) IsClosed

func (*NoopClient) IsClosed() bool

func (*NoopClient) ServiceCheck

func (*NoopClient) ServiceCheck(sc *statsd.ServiceCheck) error

func (*NoopClient) Set

func (*NoopClient) Set(name string, value string, tags []string, rate float64) error

func (*NoopClient) SimpleEvent

func (*NoopClient) SimpleEvent(title, text string) error

func (*NoopClient) SimpleServiceCheck

func (*NoopClient) SimpleServiceCheck(name string, status statsd.ServiceCheckStatus) error

func (*NoopClient) TimeInMilliseconds

func (*NoopClient) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error

func (*NoopClient) Timing

func (*NoopClient) Timing(name string, value time.Duration, tags []string, rate float64) error

Jump to

Keyboard shortcuts

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