Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustReplace ¶
MustReplace replace invalid, for OpenTSDB, characters from s and replace it with given replacement See: http://opentsdb.net/docs/build/html/user_guide/writing.html#metrics-and-tags
Types ¶
type Client ¶
type Client struct {
Queue chan *DataPoint
Clock chan *Timer
// Errors is channel for errors from workers, client should drain it
Errors chan error
// Dropped is number of dropped metrics on Push
// If this number more than zero, than you should increase bufferSize
Dropped int64
// Sent is number of sent metrics by all workers from beginning of time
Sent int64
// contains filtered or unexported fields
}
A Client is an OpenTSDB client. It should be created with NewClient.
func NewClient ¶
NewClient will create you a new client for OpenTSDB host could be ip address or hostname and may contain port bufferSize if size of internal Queue for workers
func (*Client) Push ¶
Push will add given dp to internal queue. If queue already full, then Push will return error
type DataPoint ¶
type DataPoint struct {
Metric string `json:"metric"`
Timestamp int64 `json:"timestamp"`
Value interface{} `json:"value"`
Tags Tags `json:"tags"`
}
DataPoint is a data point for the /api/put route: http://opentsdb.net/docs/build/html/api_http/put.html#example-single-data-point-put.
type DataPoints ¶
type DataPoints []*DataPoint
DataPoints holds multiple DataPoints: http://opentsdb.net/docs/build/html/api_http/put.html#example-multiple-data-point-put.
func (DataPoints) Len ¶
func (dps DataPoints) Len() int
func (DataPoints) Less ¶
func (dps DataPoints) Less(i, j int) bool
func (DataPoints) Swap ¶
func (dps DataPoints) Swap(i, j int)
type Postman ¶
type Postman struct {
// contains filtered or unexported fields
}
Postman is http client for POSTing of gzip json to TSDB
func NewPostman ¶
NewPostman initialize http.Client and all needed buffers for new new Postman