Version: v0.0.0-...-26b9065 Latest Latest

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

Go to latest
Published: Apr 24, 2020 License: Apache-2.0 Imports: 5 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Graphite

type Graphite struct {
	Host    string
	Port    int
	Timeout time.Duration
	Conn    io.Writer

Graphite is a struct that defines the relevant properties of a graphite connection

func NewGraphite

func NewGraphite(host string, port int) (*Graphite, error)

NewGraphite is a method that's used to create a new Graphite

func (*Graphite) Disconnect

func (g *Graphite) Disconnect() (err error)

Disconnect closes the Graphite.conn field

func (*Graphite) SendMetric

func (g *Graphite) SendMetric(metric Metric) error

SendMetric method can be used to just pass a metric name and value and have it be sent to the Graphite host

type Metric

type Metric struct {
	Name      string
	Value     float64
	Timestamp time.Time

Metric contains the metric fields expected by Graphite.

func (Metric) String

func (m Metric) String() string

String formats a Metric to the format expected bt Graphite.

Jump to

Keyboard shortcuts

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