bosun.org: bosun.org/cmd/bosun/search Index | Files

package search

import "bosun.org/cmd/bosun/search"

Index

Package Files

search.go

func Match Uses

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).

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 Uses

func NewSearch(data database.DataAccess, skipLast bool) *Search

func (*Search) BackupLast Uses

func (s *Search) BackupLast() error

func (*Search) Expand Uses

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

func (*Search) FilteredTagSets Uses

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

func (*Search) GetLast Uses

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 Uses

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 Uses

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

func (*Search) MetricsByTagPair Uses

func (s *Search) MetricsByTagPair(tagk, tagv string, since time.Duration) ([]string, error)

func (*Search) TagKeysByMetric Uses

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

func (*Search) TagValuesByMetricTagKey Uses

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

func (*Search) TagValuesByTagKey Uses

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

func (*Search) UniqueMetrics Uses

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

UniqueMetrics returns a sorted slice of metrics where the metric has been updated more recently than epoch

Package search imports 13 packages (graph) and is imported by 4 packages. Updated 2020-05-15. Refresh now. Tools for package owners.