common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByTime

type ByTime []IntPoint

ByTime implements Sort interface for IntPoint https://golang.org/pkg/sort/

func (ByTime) Len

func (p ByTime) Len() int

Len implements Sort interface

func (ByTime) Less

func (p ByTime) Less(i int, j int) bool

Less implements Sort interface

func (ByTime) Swap

func (p ByTime) Swap(i int, j int)

Swap implements Sort interface

type DoublePoint

type DoublePoint struct {
	TimeNano int64
	V        float64
}

type DoubleSeries

type DoubleSeries struct {
	Name   string            `json:"name"`
	Tags   map[string]string `json:"tags"`
	Points []DoublePoint     `json:"points"`
}

type IntPoint

type IntPoint struct {
	TimeNano int64
	V        int
}

IntPoint is a time, int pair but encoded as array in JSON format for space efficiency http://attilaolah.eu/2013/11/29/json-decoding-in-go/

func (*IntPoint) MarshalJSON

func (p *IntPoint) MarshalJSON() ([]byte, error)

MarshalJSON implements Marshaler interface https://golang.org/pkg/encoding/json/#Marshaler

func (*IntPoint) UnmarshalJSON

func (p *IntPoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements Unmarshaler interface https://golang.org/pkg/encoding/json/#Unmarshaler

type IntSeries

type IntSeries struct {
	Name   string            `json:"name"`
	Tags   map[string]string `json:"tags"`
	Points []IntPoint        `json:"points"`
}

func NewIntSeries

func NewIntSeries(name string) *IntSeries

func (*IntSeries) Hash

func (series *IntSeries) Hash() string

Hash returns one result for series have same name and tags

type Query

type Query struct {
	Name        string            `json:"name"`
	Tags        map[string]string `json:"tags"`
	MatchPolicy string            `json:"match_policy"`
	StartTime   int64             `json:"start_time,omitempty"`
	EndTime     int64             `json:"end_time,omitempty"`
}

Query is the query against single series if in `exact` mode, possible multiple series in `contains` mode

func (*Query) Hash

func (query *Query) Hash() string

Hash return the same result as IntSeries's hash function

type QueryResult

type QueryResult struct {
	Query
	Matched int `json:"matched"`
}

QueryResult contains the original query and number of series matched

Jump to

Keyboard shortcuts

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