plot

package
v0.0.0-...-1809aa5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolWrapper

type BoolWrapper struct {
	Bool OperatorWrapper `json:"bool"`
}

type DSoptions

type DSoptions struct {
	Downsample string `json:"approximation"`
	Unit       string `json:"unit"`
	Value      int    `json:"value"`
	Fill       string
}

type DataOperations

type DataOperations struct {
	Downsample  Downsample
	Merge       string
	Rate        RateOperation
	Order       []string
	FilterValue FilterValueOperation
}

type Downsample

type Downsample struct {
	Enabled     bool      `json:"enabled"`
	PointLimit  bool      `json:"pointLimit"`
	TotalPoints int       `json:"totalPoints"`
	Options     DSoptions `json:"options"`
}

type EsNested

type EsNested struct {
	Path      string      `json:"path"`
	ScoreMode string      `json:"score_mode,omitempty"`
	Query     BoolWrapper `json:"filter"`
}

type EsNestedQuery

type EsNestedQuery struct {
	Nested EsNested `json:"nested"`
}

type EsRegexp

type EsRegexp struct {
	Regexp map[string]string `json:"regexp"`
}

type EsRespHitsMeta

type EsRespHitsMeta struct {
	Index   string   `json:"_index"`
	Type    string   `json:"_type"`
	Id      string   `json:"_id"`
	Version int      `json:"_version,omitempty"`
	Found   bool     `json:"found,omitempty"`
	Score   float32  `json:"_score"`
	Source  MetaInfo `json:"_source"`
}

type EsRespHitsMetric

type EsRespHitsMetric struct {
	Index   string     `json:"_index"`
	Type    string     `json:"_type"`
	Id      string     `json:"_id"`
	Version int        `json:"_version,omitempty"`
	Found   bool       `json:"found,omitempty"`
	Score   float32    `json:"_score"`
	Source  MetricName `json:"_source"`
}

type EsRespHitsTag

type EsRespHitsTag struct {
	Index   string  `json:"_index"`
	Type    string  `json:"_type"`
	Id      string  `json:"_id"`
	Version int     `json:"_version,omitempty"`
	Found   bool    `json:"found,omitempty"`
	Score   float32 `json:"_score"`
	Source  TagKey  `json:"_source"`
}

type EsRespHitsTagKey

type EsRespHitsTagKey struct {
	Index   string  `json:"_index"`
	Type    string  `json:"_type"`
	Id      string  `json:"_id"`
	Version int     `json:"_version,omitempty"`
	Found   bool    `json:"found,omitempty"`
	Score   float32 `json:"_score"`
	Source  TagKey  `json:"_source"`
}

type EsRespHitsTagValue

type EsRespHitsTagValue struct {
	Index   string   `json:"_index"`
	Type    string   `json:"_type"`
	Id      string   `json:"_id"`
	Version int      `json:"_version,omitempty"`
	Found   bool     `json:"found,omitempty"`
	Score   float32  `json:"_score"`
	Source  TagValue `json:"_source"`
}

type EsRespHitsWrapperMeta

type EsRespHitsWrapperMeta struct {
	Total    int              `json:"total"`
	MaxScore float32          `json:"max_score"`
	Hits     []EsRespHitsMeta `json:"hits"`
}

type EsRespHitsWrapperMetric

type EsRespHitsWrapperMetric struct {
	Total    int                `json:"total"`
	MaxScore float32            `json:"max_score"`
	Hits     []EsRespHitsMetric `json:"hits"`
}

type EsRespHitsWrapperTag

type EsRespHitsWrapperTag struct {
	Total    int             `json:"total"`
	MaxScore float32         `json:"max_score"`
	Hits     []EsRespHitsTag `json:"hits"`
}

type EsRespHitsWrapperTagKey

type EsRespHitsWrapperTagKey struct {
	Total    int                `json:"total"`
	MaxScore float32            `json:"max_score"`
	Hits     []EsRespHitsTagKey `json:"hits"`
}

type EsRespHitsWrapperTagValue

type EsRespHitsWrapperTagValue struct {
	Total    int                  `json:"total"`
	MaxScore float32              `json:"max_score"`
	Hits     []EsRespHitsTagValue `json:"hits"`
}

type EsRespShards

type EsRespShards struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

type EsResponseMeta

type EsResponseMeta struct {
	Took     int                   `json:"took"`
	TimedOut bool                  `json:"timed_out"`
	Shards   EsRespShards          `json:"_shards"`
	Hits     EsRespHitsWrapperMeta `json:"hits"`
}

type EsResponseMetric

type EsResponseMetric struct {
	Took     int                     `json:"took"`
	TimedOut bool                    `json:"timed_out"`
	Shards   EsRespShards            `json:"_shards"`
	Hits     EsRespHitsWrapperMetric `json:"hits"`
}

type EsResponseTag

type EsResponseTag struct {
	Took     int                  `json:"took"`
	TimedOut bool                 `json:"timed_out"`
	Shards   EsRespShards         `json:"_shards"`
	Hits     EsRespHitsWrapperTag `json:"hits"`
}

type EsResponseTagKey

type EsResponseTagKey struct {
	Took     int                     `json:"took"`
	TimedOut bool                    `json:"timed_out"`
	Shards   EsRespShards            `json:"_shards"`
	Hits     EsRespHitsWrapperTagKey `json:"hits"`
}

type EsResponseTagValue

type EsResponseTagValue struct {
	Took     int                       `json:"took"`
	TimedOut bool                      `json:"timed_out"`
	Shards   EsRespShards              `json:"_shards"`
	Hits     EsRespHitsWrapperTagValue `json:"hits"`
}

type ExpParse

type ExpParse struct {
	Expression string `json:"expression"`
	Expand     bool   `json:"expand"`
	Keyspace   string `json:"keyspace"`
}

func (ExpParse) Validate

func (expp ExpParse) Validate() gobol.Error

type ExpQuery

type ExpQuery struct {
	Expression string `json:"expression"`
}

func (ExpQuery) Validate

func (eq ExpQuery) Validate() gobol.Error

type FilterValueOperation

type FilterValueOperation struct {
	Enabled  bool
	BoolOper string
	Value    float64
}

type Key

type Key struct {
	TSid string `json:"tsid"`
}

type Merge

type Merge struct {
	Option string `json:"option"`
	Keys   []Key  `json:"keys"`
}

type MetaInfo

type MetaInfo struct {
	Metric string `json:"metric"`
	ID     string `json:"id"`
	Tags   []Tag  `json:"tagsNested"`
}

type MetricName

type MetricName struct {
	Name string `json:"name"`
}

type OperatorWrapper

type OperatorWrapper struct {
	Must    []interface{} `json:"must,omitempty"`
	MustNot []interface{} `json:"must_not,omitempty"`
	Should  []interface{} `json:"should,omitempty"`
}

type Plot

type Plot struct {
	MaxTimeseries     int
	LogQueryThreshold int
	// contains filtered or unexported fields
}

func New

func New(
	gbl *logrus.Logger,
	sts *tsstats.StatsTS,
	cass *gocql.Session,
	es *rubber.Elastic,
	bc *bcache.Bcache,
	esIndex string,
	maxTimeseries int,
	maxConcurrentTimeseries int,
	maxConcurrentReads int,
	logQueryTSthreshold int,
	consist []gocql.Consistency,
) (*Plot, gobol.Error)

func (*Plot) ExpressionCheck

func (plot *Plot) ExpressionCheck(w http.ResponseWriter, expQuery ExpQuery)

func (*Plot) ExpressionCheckGET

func (plot *Plot) ExpressionCheckGET(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Plot) ExpressionCheckPOST

func (plot *Plot) ExpressionCheckPOST(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Plot) ExpressionCompile

func (plot *Plot) ExpressionCompile(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Plot) ExpressionExpandGET

func (plot *Plot) ExpressionExpandGET(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ExpressionExpandPOST

func (plot *Plot) ExpressionExpandPOST(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ExpressionParseGET

func (plot *Plot) ExpressionParseGET(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Plot) ExpressionParsePOST

func (plot *Plot) ExpressionParsePOST(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Plot) ExpressionQueryGET

func (plot *Plot) ExpressionQueryGET(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ExpressionQueryPOST

func (plot *Plot) ExpressionQueryPOST(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (Plot) GetGroups

func (plot Plot) GetGroups(filters []structs.TSDBfilter, tsobs []TSDBobj) (groups [][]TSDBobj)

func (*Plot) GetTextSeries

func (plot *Plot) GetTextSeries(
	keyspace string,
	keys []string,
	start,
	end int64,
	mergeType string,
	tuuid,
	keepEmpties bool,
	search *regexp.Regexp,
	downsample structs.Downsample,
) (serie TST, gerr gobol.Error)

func (*Plot) GetTimeSeries

func (plot *Plot) GetTimeSeries(
	keyspace string,
	keys []string,
	start,
	end int64,
	opers structs.DataOperations,
	tuuid,
	ms,
	keepEmpties bool,
) (serie TS, gerr gobol.Error)

func (Plot) ListMeta

func (plot Plot) ListMeta(
	keyspace,
	esType,
	metric string,
	tags map[string]string,
	onlyids bool,
	size,
	from int64,
) ([]TsMetaInfo, int, gobol.Error)

func (*Plot) ListMetaNumber

func (plot *Plot) ListMetaNumber(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ListMetaText

func (plot *Plot) ListMetaText(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (Plot) ListMetrics

func (plot Plot) ListMetrics(keyspace, esType, metricName string, size, from int64) ([]string, int, gobol.Error)

func (*Plot) ListMetricsNumber

func (plot *Plot) ListMetricsNumber(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ListMetricsText

func (plot *Plot) ListMetricsText(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ListPoints

func (plot *Plot) ListPoints(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (Plot) ListTagKey

func (plot Plot) ListTagKey(keyspace, tagKname string, size, from int64) ([]string, int, gobol.Error)

func (Plot) ListTagValue

func (plot Plot) ListTagValue(keyspace, tagVname string, size, from int64) ([]string, int, gobol.Error)

func (Plot) ListTags

func (plot Plot) ListTags(keyspace, esType, tagKey string, size, from int64) ([]string, int, gobol.Error)

func (*Plot) ListTagsNumber

func (plot *Plot) ListTagsNumber(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) ListTagsText

func (plot *Plot) ListTagsText(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) Lookup

func (plot *Plot) Lookup(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) MetaFilterOpenTSDB

func (plot *Plot) MetaFilterOpenTSDB(
	keyspace,
	id,
	metric string,
	filters []structs.TSDBfilter,
	size int64,
) ([]TSDBobj, int, gobol.Error)

func (*Plot) MetaOpenTSDB

func (plot *Plot) MetaOpenTSDB(
	keyspace,
	id,
	metric string,
	tags map[string][]string,
	size,
	from int64,
) ([]TSDBobj, int, gobol.Error)

func (*Plot) Query

func (plot *Plot) Query(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

func (*Plot) SetConsistencies

func (plot *Plot) SetConsistencies(consistencies []gocql.Consistency)

func (*Plot) Suggest

func (plot *Plot) Suggest(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

type Pnt

type Pnt struct {
	Date  int64
	Value float64
	Empty bool
}

type Pnts

type Pnts []Pnt

func (Pnts) Len

func (s Pnts) Len() int

func (Pnts) Less

func (s Pnts) Less(i, j int) bool

func (Pnts) Swap

func (s Pnts) Swap(i, j int)

type QueryWrapper

type QueryWrapper struct {
	Size   int64       `json:"size,omitempty"`
	From   int64       `json:"from,omitempty"`
	Query  BoolWrapper `json:"filter"`
	Fields []string    `json:"fields,omitempty"`
}

type RateOperation

type RateOperation struct {
	Enabled bool
	Options TSDBrateOptions
}

type Response

type Response struct {
	TotalRecords int         `json:"totalRecords,omitempty"`
	Payload      interface{} `json:"payload,omitempty"`
	Message      interface{} `json:"message,omitempty"`
}

type Series

type Series struct {
	Text   interface{} `json:"text,omitempty"`
	Trend  interface{} `json:"trend,omitempty"`
	Points interface{} `json:"points,omitempty"`
}

type SeriesType

type SeriesType struct {
	Count int         `json:"count"`
	Total int         `json:"total"`
	Type  string      `json:"type,omitempty"`
	Ts    interface{} `json:"ts"`
}

type TS

type TS struct {
	Count int
	Total int
	Data  Pnts
	// contains filtered or unexported fields
}

type TSDBfilter

type TSDBfilter struct {
	Ftype   string `json:"type"`
	Tagk    string `json:"tagk"`
	Filter  string `json:"filter"`
	GroupBy bool   `json:"groupBy"`
}

type TSDBlookup

type TSDBlookup struct {
	Type         string    `json:"type"`
	Metric       string    `json:"metric"`
	Tags         []Tag     `json:"tags"`
	Limit        int       `json:"limit"`
	Time         int       `json:"time"`
	Results      []TSDBobj `json:"results"`
	StartIndex   int       `json:"startIndex"`
	TotalResults int       `json:"totalResults"`
}

type TSDBobj

type TSDBobj struct {
	Tsuid  string            `json:"tsuid"`
	Metric string            `json:"metric"`
	Tags   map[string]string `json:"tags"`
}

type TSDBrateOptions

type TSDBrateOptions struct {
	Counter    bool   `json:"counter"`
	CounterMax *int64 `json:"counterMax,omitempty"`
	ResetValue int64  `json:"resetValue,omitempty"`
}

type TSDBresponse

type TSDBresponse struct {
	Metric         string                 `json:"metric"`
	Tags           map[string]string      `json:"tags"`
	AggregatedTags []string               `json:"aggregateTags"`
	Tsuids         []string               `json:"tsuids,omitempty"`
	Dps            map[string]interface{} `json:"dps"`
}

type TSDBresponses

type TSDBresponses []TSDBresponse
type TSDBquery struct {
	Aggregator  string            `json:"aggregator"`
	Downsample  string            `json:"downsample,omitempty"`
	Metric      string            `json:"metric"`
	Tags        map[string]string `json:"tags"`
	Rate        bool              `json:"rate,omitempty"`
	RateOptions TSDBrateOptions   `json:"rateOptions,omitempty"`
	Order       []string          `json:"order,omitempty"`
	FilterValue string            `json:"filterValue,omitempty"`
	Filters     []TSDBfilter      `json:"filters,omitempty"`
}
type TSDBqueryPayload struct {
	Start        int64       `json:"start,omitempty"`
	End          int64       `json:"end,omitempty"`
	Relative     string      `json:"relative,omitempty"`
	Queries      []structs.TSDBquery `json:"queries"`
	ShowTSUIDs   bool        `json:"showTSUIDs"`
	MsResolution bool        `json:"msResolution"`
}

func (query TSDBqueryPayload) Validate() gobol.Error {

	if query.Relative != "" {
		if err := query.checkDuration(query.Relative); err != nil {
			return err
		}
	}

	if len(query.Queries) == 0 {
		return errTSDBquery(fmt.Errorf("At least one quey should be present"))
	}

	for i, q := range query.Queries {

		if err := query.checkField("metric", q.Metric); err != nil {
			return err
		}

		if err := query.checkAggregator(q.Aggregator); err != nil {
			return err
		}

		if q.Downsample != "" {

			ds := strings.Split(q.Downsample, "-")

			if len(ds) < 2 {
				return errTSDBquery(fmt.Errorf("invalid downsample format"))
			}

			if err := query.checkDuration(ds[0]); err != nil {
				return err
			}

			if err := query.checkDownsampler(ds[1]); err != nil {
				return err
			}

			if len(ds) > 2 {
				if err := query.checkFiller(ds[2]); err != nil {
					return err
				}
			}

		}

		if q.Rate {
			if err := query.checkRate(q.RateOptions); err != nil {
				return err
			}
		}

		if q.FilterValue != "" {
			q.FilterValue = strings.Replace(q.FilterValue, " ", "", -1)
			query.Queries[i].FilterValue = q.FilterValue

			if len(q.FilterValue) < 2 {
				return errTSDBquery(fmt.Errorf("invalid filter value %s", q.FilterValue))
			}

			if q.FilterValue[:2] == ">=" || q.FilterValue[:2] == "<=" || q.FilterValue[:2] == "==" {
				_, err := strconv.ParseFloat(q.FilterValue[2:], 64)
				if err != nil {
					return errTSDBquery(err)
				}
			} else if q.FilterValue[:1] == ">" || q.FilterValue[:1] == "<" {
				_, err := strconv.ParseFloat(q.FilterValue[1:], 64)
				if err != nil {
					return errTSDBquery(err)
				}
			} else {
				return errTSDBquery(fmt.Errorf("invalid filter value %s", q.FilterValue))
			}
		}

		if len(q.Order) == 0 {

			if q.FilterValue != "" {
				query.Queries[i].Order = append(query.Queries[i].Order, "filterValue")
			}

			if q.Downsample != "" {
				query.Queries[i].Order = append(query.Queries[i].Order, "downsample")
			}

			query.Queries[i].Order = append(query.Queries[i].Order, "aggregation")

			if q.Rate {
				query.Queries[i].Order = append(query.Queries[i].Order, "rate")
			}

		} else {

			orderCheck := make([]string, len(q.Order))

			copy(orderCheck, q.Order)

			k := 0
			occur := 0
			for j, order := range orderCheck {

				if order == "aggregation" {
					k = j
					occur++
				}

			}

			if occur == 0 {
				return errTSDBquery(
					fmt.Errorf("aggregation configured but no aggregation found in order array"),
				)
			}

			if occur > 1 {
				return errTSDBquery(fmt.Errorf("more than one aggregation found in order array"))
			}

			if occur == 1 {
				orderCheck = append(orderCheck[:k], orderCheck[k+1:]...)
			}

			k = 0
			occur = 0
			for j, order := range orderCheck {

				if order == "filterValue" {
					k = j
					occur++
				}

			}

			if q.FilterValue != "" && occur == 0 {
				return errTSDBquery(
					fmt.Errorf("filterValue configured but no filterValue found in order array"),
				)
			}

			if occur > 1 {
				return errTSDBquery(fmt.Errorf("more than one filterValue found in order array"))
			}

			if occur == 1 {
				orderCheck = append(orderCheck[:k], orderCheck[k+1:]...)
			}

			k = 0
			occur = 0
			for j, order := range orderCheck {

				if order == "downsample" {
					k = j
					occur++
				}

			}

			if q.Downsample != "" && occur == 0 {
				return errTSDBquery(
					fmt.Errorf(
						"downsample configured but no downsample found in order array",
					),
				)
			}

			if occur > 1 {
				return errTSDBquery(fmt.Errorf("more than one downsample found in order array"))
			}

			if occur == 1 {
				orderCheck = append(orderCheck[:k], orderCheck[k+1:]...)
			}

			k = 0
			occur = 0
			for j, order := range orderCheck {

				if order == "rate" {
					k = j
					occur++
				}

			}

			if q.Rate && occur == 0 {
				return errTSDBquery(fmt.Errorf("rate configured but no rate found in order array"))
			}

			if occur > 1 {
				return errTSDBquery(fmt.Errorf("more than one rate found in order array"))
			}

			if occur == 1 {
				orderCheck = append(orderCheck[:k], orderCheck[k+1:]...)
			}

			if len(orderCheck) != 0 {
				return errTSDBquery(fmt.Errorf("invalid operations in order array %v", orderCheck))
			}

		}

		if err := query.checkFilter(q.Filters); err != nil {
			return err
		}

	}

	return nil
}

func (query TSDBqueryPayload) checkRate(opts TSDBrateOptions) gobol.Error {

	if opts.CounterMax != nil && *opts.CounterMax < 0 {
		return errRate("counter max needs to be a positive integer")
	}

	return nil
}

func (query TSDBqueryPayload) checkAggregator(aggr string) gobol.Error {

	ok := false

	for _, vAggr := range config.GetAggregators() {
		if vAggr == aggr {
			ok = true
			break
		}
	}

	if !ok {
		return errAggregator("unkown aggregation value")
	}

	return nil
}

func (query TSDBqueryPayload) checkDownsampler(DSr string) gobol.Error {

	ok := false

	for _, vDSr := range config.GetDownsamplers() {
		if vDSr == DSr {
			ok = true
			break
		}
	}

	if !ok {
		return errDownsampler("Invalid downsample")
	}

	return nil
}

func (query TSDBqueryPayload) checkFiller(DSf string) gobol.Error {

	ok := false

	for _, vDSf := range config.GetFillers() {
		if vDSf == DSf {
			ok = true
			break
		}
	}

	if !ok {
		return errFiller("Invalid fill value")
	}

	return nil
}

func (query TSDBqueryPayload) checkFilter(filters []TSDBfilter) gobol.Error {

	vFilters := config.GetFilters()

	for _, filter := range filters {

		ok := false

		ft := filter.Ftype

		if ft == "iliteral_or" {
			ft = "literal_or"
		} else if ft == "not_iliteral_or" {
			ft = "not_literal_or"
		} else if ft == "iwildcard" {
			ft = "wildcard"
		}

		for _, vFilter := range vFilters {
			if ft == vFilter {
				ok = true
				break
			}
		}
		if !ok {
			return errFilter(fmt.Sprintf("Invalid filter type %s", filter.Ftype))
		}

		if err := query.checkField("tagk", filter.Tagk); err != nil {
			return err
		}

		if err := query.checkFilterField("filter", ft, filter.Filter); err != nil {
			return err
		}
	}

	return nil
}

func (query TSDBqueryPayload) checkDuration(s string) gobol.Error {

	if len(s) < 2 {
		return errCheckDuration(fmt.Errorf("Invalid time interval"))
	}

	var n int
	var err error

	if string(s[len(s)-2:]) == "ms" {
		n, err = strconv.Atoi(string(s[:len(s)-2]))
		if err != nil {
			return errCheckDuration(err)
		}
		return nil
	}

	switch s[len(s)-1:] {
	case "s", "m", "h", "d", "w", "n", "y":
		n, err = strconv.Atoi(string(s[:len(s)-1]))
		if err != nil {
			return errCheckDuration(err)
		}
	default:
		return errCheckDuration(fmt.Errorf("Invalid unit"))
	}

	if n < 1 {
		return errCheckDuration(fmt.Errorf("interval needs to be bigger than 0"))
	}

	return nil
}

func (query TSDBqueryPayload) checkField(n, f string) gobol.Error {

	if !validFields.MatchString(f) {
		return errField(fmt.Sprintf("Invalid characters in field %s: %s", n, f))
	}
	return nil
}

func (query TSDBqueryPayload) checkFilterField(n, tf, f string) gobol.Error {

	match := false

	switch tf {
	case "wildcard":
		match = validFwild.MatchString(f)
	case "literal_or", "not_literal_or":
		match = validFor.MatchString(f)
	case "regexp":
		match = true
	}

	if !match {
		return errFilterField(fmt.Sprintf("Invalid characters in field %s: %s", n, f))
	}

	return nil
}

func (TSDBresponses) Len

func (r TSDBresponses) Len() int

func (TSDBresponses) Less

func (r TSDBresponses) Less(i, j int) bool

func (TSDBresponses) Swap

func (r TSDBresponses) Swap(i, j int)

type TST

type TST struct {
	Count int
	Total int
	Data  TextPnts
	// contains filtered or unexported fields
}

type TSmeta

type TSmeta struct {
	Key    string `json:"key"`
	Metric string `json:"metric"`
	Tags   []Tag  `json:"tags"`
}

func (TSmeta) Validate

func (tsm TSmeta) Validate() gobol.Error

type Tag

type Tag struct {
	Key   string `json:"tagKey"`
	Value string `json:"tagValue"`
}

type TagKey

type TagKey struct {
	Key string `json:"key"`
}

type TagValue

type TagValue struct {
	Value string `json:"value"`
}

type Term

type Term struct {
	Term map[string]string `json:"term"`
}

type TextPnt

type TextPnt struct {
	Date  int64  `json:"x"`
	Value string `json:"title"`
}

type TextPnts

type TextPnts []TextPnt

func (TextPnts) Len

func (s TextPnts) Len() int

func (TextPnts) Less

func (s TextPnts) Less(i, j int) bool

func (TextPnts) Swap

func (s TextPnts) Swap(i, j int)

type TsMetaInfo

type TsMetaInfo struct {
	TsId   string            `json:"id"`
	Metric string            `json:"metric,omitempty"`
	Tags   map[string]string `json:"tags,omitempty"`
}

type TsQuery

type TsQuery struct {
	Downsample Downsample       `json:"downsample"`
	Start      int64            `json:"start"`
	End        int64            `json:"end"`
	Keys       []Key            `json:"keys"`
	Merge      map[string]Merge `json:"merge"`
	Text       []Key            `json:"text"`
	TextSearch string           `json:"textSearch"`
	// contains filtered or unexported fields
}

func (*TsQuery) Validate

func (query *TsQuery) Validate() gobol.Error

Jump to

Keyboard shortcuts

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