stats

package
v0.0.0-...-19b6972 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stats is a very lightweight wrapper around the dogstatsd client, which gives us a package-level function

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(host string, port int) error

Configure sets up statsd

func Incr

func Incr(key string, tags []string)

Incr increment a thing

func IncrFail

func IncrFail(prefix string, tags []string)

IncrFail increment success

func IncrSuccess

func IncrSuccess(prefix string, tags []string)

IncrSuccess increment success

func Timing

func Timing(name string, took time.Duration, tags []string)

Timing run a function and record timing

Types

type NopClient

type NopClient struct{}

func (NopClient) Gauge

func (NopClient) Gauge(_ string, _ float64, _ []string, _ float64) error

func (NopClient) Incr

func (NopClient) Incr(_ string, _ []string, _ float64) error

func (NopClient) Timing

func (NopClient) Timing(_ string, _ time.Duration, _ []string, _ float64) error

type StatsClient

type StatsClient interface {
	Timing(name string, took time.Duration, tags []string, v float64) error
	Incr(name string, tags []string, rate float64) error
	Gauge(name string, value float64, tags []string, rate float64) error
}

func Client

func Client() StatsClient

Client returns the statsd client

Jump to

Keyboard shortcuts

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