graphite: Index | Files

package client

import ""


Package Files

client.go metric.go

type Graphite Uses

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 Uses

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

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

func (*Graphite) Disconnect Uses

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

Disconnect closes the Graphite.conn field

func (*Graphite) SendMetric Uses

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 Uses

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

Metric contains the metric fields expected by Graphite.

func (Metric) String Uses

func (m Metric) String() string

String formats a Metric to the format expected bt Graphite.

Package client imports 5 packages (graph) and is imported by 1 packages. Updated 2019-03-26. Refresh now. Tools for package owners.