search

package
v0.0.0-...-f7a0673 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(search string, values []string) ([]string, error)

Match returns all matching values against search. search is a regex, except that `.` is literal, `*` can be used for `.*`, and the entire string is searched (`^` and `&` added to ends of search).

Types

type MetricTagSet

type MetricTagSet struct {
	Metric string          `json:"metric"`
	Tags   opentsdb.TagSet `json:"tags"`
}
type Search struct {
	// tagk + tagv -> metrics
	Metric qmap
	// metric -> tag keys
	Tagk smap
	// metric + tagk -> tag values
	Tagv qmap

	Last map[string]*pair

	// Read replica. Should never be mutated. Can at any time be assigned to a new
	// value.
	Read *Search

	sync.RWMutex
	// contains filtered or unexported fields
}

Search is a struct to hold indexed data about OpenTSDB metric and tag data. It is suited to answering questions about: available metrics for a tag set, available tag keys for a metric, and available tag values for a metric and tag key.

func NewSearch

func NewSearch() *Search

func (*Search) Copy

func (s *Search) Copy()

Copy copies current data to the Read replica.

func (*Search) Expand

func (s *Search) Expand(q *opentsdb.Query) error

func (*Search) GetLast

func (s *Search) GetLast(metric, tags string, diff bool) (v float64, err error)

GetLast returns the value of the most recent data point for the given metric and tag. tags should be of the form "{key=val,key2=val2}". If diff is true, the value is treated as a counter. err is non nil if there is no match.

func (*Search) Index

func (s *Search) Index(mdp opentsdb.MultiDataPoint)

func (*Search) MetricsByTagPair

func (s *Search) MetricsByTagPair(Tagk, Tagv string) []string

func (*Search) MetricsWithTagKeys

func (s *Search) MetricsWithTagKeys() map[string][]string

func (*Search) TagKeysByMetric

func (s *Search) TagKeysByMetric(Metric string) []string

func (*Search) TagValuesByMetricTagKey

func (s *Search) TagValuesByMetricTagKey(Metric, Tagk string, since time.Duration) []string

func (*Search) TagValuesByTagKey

func (s *Search) TagValuesByTagKey(Tagk string, since time.Duration) []string

func (*Search) UniqueMetrics

func (s *Search) UniqueMetrics() []string

Jump to

Keyboard shortcuts

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