Documentation ¶
Index ¶
- type Graphite
- func GraphiteFactory(protocol string, host string, port int, prefix string) (*Graphite, error)
- func NewGraphite(host string, port int) (*Graphite, error)
- func NewGraphiteNop(host string, port int) *Graphite
- func NewGraphiteUDP(host string, port int) (*Graphite, error)
- func NewGraphiteWithMetricPrefix(host string, port int, prefix string) (*Graphite, error)
- func (graphite *Graphite) Connect() error
- func (graphite *Graphite) Disconnect() error
- func (graphite *Graphite) IsNop() bool
- func (graphite *Graphite) SendMetric(metric Metric) error
- func (graphite *Graphite) SendMetrics(metrics []Metric) error
- func (graphite *Graphite) SendTaggedMetric(metric *TaggedMetric) error
- func (graphite *Graphite) SendTaggedMetrics(metrics []*TaggedMetric) error
- func (graphite *Graphite) SimpleSend(stat string, value string) error
- type Metric
- type Tag
- type TaggedMetric
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 Protocol string Timeout time.Duration Prefix string // contains filtered or unexported fields }
Graphite is a struct that defines the relevant properties of a graphite connection
func GraphiteFactory ¶
func NewGraphite ¶
NewGraphite is a factory method that's used to create a new Graphite
func NewGraphiteNop ¶
NewGraphiteNop is a factory method that returns a Graphite struct but will not actually try to send any packets to a remote host and, instead, will just log. This is useful if you want to use Graphite in a project but don't want to make Graphite a requirement for the project.
func NewGraphiteUDP ¶
When a UDP connection to Graphite is required
func NewGraphiteWithMetricPrefix ¶
NewGraphiteWithMetricPrefix is a factory method that's used to create a new Graphite with a metric prefix
func (*Graphite) Connect ¶
Given a Graphite struct, Connect populates the Graphite.conn field with an appropriate TCP connection
func (*Graphite) Disconnect ¶
Given a Graphite struct, Disconnect closes the Graphite.conn field
func (*Graphite) SendMetric ¶
Given a Metric struct, the SendMetric method sends the supplied metric to the Graphite connection that the method is called upon
func (*Graphite) SendMetrics ¶
Given a slice of Metrics, the SendMetrics method sends the metrics, as a batch, to the Graphite connection that the method is called upon
func (*Graphite) SendTaggedMetric ¶
func (graphite *Graphite) SendTaggedMetric(metric *TaggedMetric) error
Given a TaggedMetric struct, the SendTaggedMetric method sends the supplied metric to the Graphite connection that the method is called upon
func (*Graphite) SendTaggedMetrics ¶
func (graphite *Graphite) SendTaggedMetrics(metrics []*TaggedMetric) error
Given a slice of TaggedMetric, the SendTaggedMetrics method sends the metrics, as a batch, to the Graphite connection that the method is called upon
type TaggedMetric ¶
TaggedMetric is a struct that defines the relevant properties of a graphite metric for Pickle format
func NewTaggedMetric ¶
func NewTaggedMetric(name string, value int, timestamp int64) *TaggedMetric
func (*TaggedMetric) AddTag ¶
func (metric *TaggedMetric) AddTag(tag *Tag)
func (*TaggedMetric) GetTags ¶
func (metric *TaggedMetric) GetTags() string
func (*TaggedMetric) String ¶
func (metric *TaggedMetric) String() string