librato

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 8 Imported by: 12

README

librato Build Status codecov Go Report Card

Basic Librato client library with batching of events. Thus far it only supports sending gauge values because that's all we need, but contributions welcome.

Usage

You can either instantiate a collector and use that:

import "github.com/nyaruka/librato"

collector := librato.NewCollector(...)
collector.Start()
collector.Gauge("awesomeness.level", 10)
collector.Gauge("foo.count", 123.45)
collector.Stop()

Or configure the default collector and use it like:

librato.Configure(...)
librato.Start()
librato.Gauge("awesomeness.level", 10)
librato.Gauge("foo.count", 123.45)
librato.Stop()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

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

Configure configures the default collector

func Gauge

func Gauge(name string, value float64)

Gauge records a new gauge value

func Start

func Start()

Start starts the analytics collector

func Stop

func Stop()

Stop stops the analytics collector

Types

type Collector

type Collector interface {
	Start()
	Gauge(name string, value float64)
	Stop()
}

Collector is anything which can collect analytics

func NewCollector

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

NewCollector creates a new librato Sender with the passed in parameters

Jump to

Keyboard shortcuts

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