opentsdbhttp

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParser

func GetParser() *fastjson.Parser

GetParser returns JSON parser.

The parser must be returned to the pool via PutParser when no longer needed.

func ParseStream added in v1.34.0

func ParseStream(req *http.Request, callback func(rows []Row) error) error

ParseStream parses OpenTSDB http lines from req and calls callback for the parsed rows.

The callback can be called multiple times for streamed data from req.

callback shouldn't hold rows after returning.

func PutParser

func PutParser(p *fastjson.Parser)

PutParser returns p to the pool.

p cannot be used after returning to the pool.

Types

type Row

type Row struct {
	Metric    string
	Tags      []Tag
	Value     float64
	Timestamp int64
}

Row is a single OpenTSDB row.

type Rows

type Rows struct {
	Rows []Row
	// contains filtered or unexported fields
}

Rows contains parsed OpenTSDB rows.

func (*Rows) Reset

func (rs *Rows) Reset()

Reset resets rs.

func (*Rows) Unmarshal

func (rs *Rows) Unmarshal(av *fastjson.Value)

Unmarshal unmarshals OpenTSDB rows from av.

See http://opentsdb.net/docs/build/html/api_http/put.html

s must be unchanged until rs is in use.

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is an OpenTSDB tag.

Jump to

Keyboard shortcuts

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