opentsdb

package
v0.0.0-...-5fd45dc Latest Latest
Warning

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

Go to latest
Published: May 6, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyString = ""
)

Variables

This section is empty.

Functions

func Meta

func Meta() *plugin.PluginMeta

Meta returns a plugin meta data

func NewOpentsdbPublisher

func NewOpentsdbPublisher() *opentsdbPublisher

NewOpentsdbPublisher returns an instance of the OpenTSDB publisher

Types

type Client

type Client interface {
	NewClient(url string, timeout time.Duration) *HttpClient
}

type DataPoint

type DataPoint struct {
	Metric    StringValue            `json:"metric"`
	Timestamp int64                  `json:"timestamp"`
	Value     interface{}            `json:"value"`
	Tags      map[string]StringValue `json:"tags"`
}

func (*DataPoint) Valid

func (d *DataPoint) Valid() bool

Valid verifies the mandatory fields of the Datapoint.

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string, timeout time.Duration) *HttpClient

NewClient creates an instance of HttpClient which times out at the givin duration.

func (*HttpClient) Post

func (hc *HttpClient) Post(dps []DataPoint) error

Post stores slides of Datapoint to OpenTSDB

type StringValue

type StringValue string

StringValue implements Json interface to replece invalid characters.

func (StringValue) MarshalJSON

func (sv StringValue) MarshalJSON() ([]byte, error)

func (*StringValue) UnmarshalJSON

func (sv *StringValue) UnmarshalJSON(json []byte) error

Jump to

Keyboard shortcuts

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