statsd

package module
v0.8.26-1d0208f Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT Imports: 3 Imported by: 0

README

lib.statsd

Build Status GoDoc Report card

Simple Statsd implementation

Dev guide

1. Install Go
2. Set your $GOPATH variable, read more here

$GOPATH should point to a directory where you store ( or intend to store) all of your go projects.

export GOPATH=$HOME/projects/all-the-go-projects
3. Install govendor.

We are using govendor. Install it:

go get -u github.com/kardianos/govendor/...

To get a dependency into a vendor directory:

govendor fetch github.com/cameronnewman/lib.statsd/

To synch dependencies with the vendor directory:

govendor update +external
5. Clone the repo with go get command
cd $GOPATH
go get github.com/cameronnewman/lib.statsd/...

Tests

make test

Documentation

Overview

Package statsd is simple statsd warpper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StatsdHost      string `json:"statsd_host"`
	StatsdPort      int    `json:"statsd_port"`
	StatsdNamespace string `json:"statsd_namespace"`
}

Config for statsd

type Stats

type Stats interface {
	StatsCounter(key string, value int64)
	StatsGauge(key string, value int64)
	Timing(key string, start time.Time)
	TimingDuration(key string, duration time.Duration)
}

Stats interface

type Statsd

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

Statsd used to monitor and measure performance

func New

func New(cfg *Config) (*Statsd, error)

New creates a statsd client instance

func (*Statsd) StatsCounter

func (stsd *Statsd) StatsCounter(key string, value int64)

StatsCounter increase counter for key

func (*Statsd) StatsGauge

func (stsd *Statsd) StatsGauge(key string, value int64)

StatsGauge gauge for key

func (*Statsd) Timing

func (stsd *Statsd) Timing(key string, start time.Time)

Timing measure for key

func (*Statsd) TimingDuration

func (stsd *Statsd) TimingDuration(key string, duration time.Duration)

TimingDuration measures duration for key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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