Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.