analytics

package
v0.0.0-...-bb7c160 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gauge

func Gauge(name string, value float64)

Gauge records a gauge value on all backends

func RegisterBackend

func RegisterBackend(b Backend)

RegisterBackend registers a new backend

func Start

func Start() error

Start starts all backends

func Stop

func Stop() error

Stop stops all backends

Types

type Backend

type Backend interface {
	Name() string
	Start() error
	Gauge(string, float64)
	Stop() error
}

Backend is the interface for backends

type ConsoleBackend

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

ConsoleBackend is a backend which prints to the console or any output stream

func NewConsole

func NewConsole(out io.Writer) *ConsoleBackend

NewConsole creates a new console backend

func (*ConsoleBackend) Gauge

func (b *ConsoleBackend) Gauge(name string, value float64)

func (*ConsoleBackend) Name

func (b *ConsoleBackend) Name() string

func (*ConsoleBackend) Start

func (b *ConsoleBackend) Start() error

func (*ConsoleBackend) Stop

func (b *ConsoleBackend) Stop() error

type LibratoBackend

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

LibratoBackend is a backend which sends analytics to Librato

func NewLibrato

func NewLibrato(username, token, source string, timeout time.Duration, waitGroup *sync.WaitGroup) *LibratoBackend

func (*LibratoBackend) Gauge

func (b *LibratoBackend) Gauge(name string, value float64)

func (*LibratoBackend) Name

func (b *LibratoBackend) Name() string

func (*LibratoBackend) Start

func (b *LibratoBackend) Start() error

func (*LibratoBackend) Stop

func (b *LibratoBackend) Stop() error

Jump to

Keyboard shortcuts

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