stats

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2017 License: MIT Imports: 2 Imported by: 8

Documentation

Overview

Package stats provides functions for reporting metrics to a service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats interface {
	Start()
	Stop()

	// Count is a simple counter
	Count(key string, n interface{}, meta ...map[string]string)
	// Inc increments the given counter by 1
	Inc(key string, meta ...map[string]string)
	// Dec decrements the given counter by 1
	Dec(key string, meta ...map[string]string)
	// Gauge measures the amount, level, or contents of something
	// The given value replaces the current one
	// e.g. in-flight requests, uptime, ...
	Gauge(key string, n interface{}, meta ...map[string]string)
	// Timing measures how long it takes to accomplish something
	// e.g. algorithm, request, ...
	Timing(key string, t time.Duration, meta ...map[string]string)
	// Histogram measures the distribution of values over the time
	Histogram(key string, n interface{}, tags ...map[string]string)

	SetLogger(l log.Logger)
}

Stats is an interface for app statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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