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 ¶
Metric contains fields used for sending metrics to Graphite. If Timestamp is not set, one is generated when sent.
func (*Metric) HasEmptyField ¶
HasEmptyField is a helper function to determine if any Metric fields are empty.