graphite

package module
v0.0.0-...-611121b Latest Latest
Warning

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

Go to latest
Published: May 31, 2013 License: BSD-2-Clause Imports: 5 Imported by: 1

README

graphite-go

Graphite library in go(lang)

Documentation

Overview

Package graphite implements sending metrics to Graphite via the Carbon text API

This can be done by sending metrics one at a time or by buffering them through a channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graphite

type Graphite interface {
	SendMetric()
	Sendall()
	// contains filtered or unexported methods
}

Graphite is the main interface to the library

type GraphiteServer

type GraphiteServer struct {
	Host    string
	Port    uint16
	Timeout time.Duration
	// contains filtered or unexported fields
}

GraphiteServer is used to store the Graphite parameters

func Connect

func Connect(graphite GraphiteServer) GraphiteServer

Connect is a factory function for Graphite connection

func (*GraphiteServer) SendMetric

func (g *GraphiteServer) SendMetric(metric Metric)

SendMetric is used to send a single metric to Graphite. Sets metric.Timestamp to current Unix time if necessary.

func (*GraphiteServer) Sendall

func (g *GraphiteServer) Sendall(buf []Metric)

Sendall is used to buffered metrics to Graphite via a channel and go routines.

type Metric

type Metric struct {
	Name      string
	Value     string
	Timestamp int64
}

Metric contains fields used for sending metrics to Graphite. If Timestamp is not set, one is generated when sent.

func (*Metric) HasEmptyField

func (m *Metric) HasEmptyField() bool

HasEmptyField is a helper function to determine if any Metric fields are empty.

Jump to

Keyboard shortcuts

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