search

package
Version: v0.0.0-...-0df215e Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2016 License: MIT Imports: 13 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 Search struct {
	DataAccess database.DataAccess

	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(data database.DataAccess) *Search

func (*Search) BackupLast

func (s *Search) BackupLast() error

func (*Search) Expand

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

func (*Search) FilteredTagSets

func (s *Search) FilteredTagSets(metric string, tags opentsdb.TagSet) ([]opentsdb.TagSet, error)

func (*Search) GetLast

func (s *Search) GetLast(metric, tags string, diff bool) (v float64, t int64, 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) GetLastInt64

func (s *Search) GetLastInt64(metric, tags string, diff bool) (int64, int64, error)

GetLastInt64 is like GetLast but converts the value to an int64

func (*Search) Index

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

func (*Search) MetricsByTagPair

func (s *Search) MetricsByTagPair(tagk, tagv string) ([]string, error)

func (*Search) TagKeysByMetric

func (s *Search) TagKeysByMetric(metric string) ([]string, error)

func (*Search) TagValuesByMetricTagKey

func (s *Search) TagValuesByMetricTagKey(metric, tagK string, since time.Duration) ([]string, error)

func (*Search) TagValuesByTagKey

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

func (*Search) UniqueMetrics

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

Source Files

Jump to

Keyboard shortcuts

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