parser

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSeriesIterators added in v0.15.3

func BuildSeriesIterators(
	series []IngestSeries,
	start time.Time,
	blockSize time.Duration,
	opts Options,
) (encoding.SeriesIterators, error)

BuildSeriesIterators builds series iterators from parser data.

Types

type Data added in v0.15.3

type Data []ts.Datapoint

Data is a set of datapoints.

type Datapoint

type Datapoint struct {
	Value     Value     `json:"val"`
	Timestamp time.Time `json:"ts"`
}

Datapoint is a JSON serializeable datapoint for the series.

type Datapoints

type Datapoints []Datapoint

Datapoints is a JSON serializeable list of values for the series.

type IngestSeries added in v0.15.3

type IngestSeries struct {
	Datapoints []Data
	Tags       Tags
}

IngestSeries is a series that can be ingested by the parser.

type Options added in v0.15.3

type Options struct {
	EncoderPool       encoding.EncoderPool
	IteratorPools     encoding.IteratorPools
	TagOptions        models.TagOptions
	InstrumentOptions instrument.Options
	Size              int
}

Options are options for series parsing.

type Series

type Series struct {
	Start      time.Time  `json:"start"`
	End        time.Time  `json:"end"`
	Tags       Tags       `json:"tags"`
	Datapoints Datapoints `json:"datapoints"`
	// contains filtered or unexported fields
}

Series is a flat JSON serializable representation of the series.

func (*Series) IDOrGenID

func (r *Series) IDOrGenID() string

IDOrGenID gets the ID for this result.

type SeriesReader added in v0.15.3

type SeriesReader interface {
	SeriesIterators(name string) (encoding.SeriesIterators, error)
	Load(reader io.Reader) error
	Clear()
}

SeriesReader reads SeriesIterators from a generic io.Reader.

func NewSeriesReader added in v0.15.3

func NewSeriesReader(opts Options) SeriesReader

NewSeriesReader creates a new SeriesReader that reads entries as a slice of Series.

type Tag

type Tag [2]string

Tag is a simple JSON serializable representation of a tag.

func NewTag

func NewTag(name, value string) Tag

NewTag creates a new tag with a given name and value.

func (Tag) Name

func (t Tag) Name() string

Name returns the tag name.

func (Tag) Value

func (t Tag) Value() string

Value returns the tag value.

type Tags

type Tags []Tag

Tags is a simple JSON serializable representation of tags.

func (Tags) Get

func (t Tags) Get(name string) []string

Get returns a list of tag values with the given name.

type Value

type Value float64

Value is a JSON serizlizable float64 that allows NaNs.

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

MarshalJSON returns state as the JSON encoding of a Value.

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals JSON-encoded data into a Value.

Jump to

Keyboard shortcuts

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