plot

package
v2.25.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: GPL-3.0 Imports: 25 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 ExpParse

type ExpParse struct {
	Expression string `json:"expression"`
	Expand     bool   `json:"expand"`
	Keyset     string `json:"ksid"`
}

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 Plot

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

func New

func New(
	cass *gocql.Session,
	metaStorage *metadata.Storage,
	maxTimeseries int,
	logQueryTSthreshold int,
	keyspaceTTLMap map[int]string,
	defaultTTL int,
	defaultMaxResults int,
	maxBytesLimit uint32,
	stats *tsstats.StatsTS,
) (*Plot, gobol.Error)

func (*Plot) DeleteNumberTS

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

DeleteNumberTS - delete number serie(s)

func (*Plot) DeleteTextTS

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

DeleteTextTS - delete text serie(s)

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, ps 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) FilterMetrics

func (plot *Plot) FilterMetrics(keyset, metricName string, size int) ([]string, int, gobol.Error)

func (*Plot) FilterTagKeys

func (plot *Plot) FilterTagKeys(keyset, tagKname string, size int) ([]string, int, gobol.Error)

func (*Plot) FilterTagValues

func (plot *Plot) FilterTagValues(keyset, tagVname string, size int) ([]string, int, gobol.Error)

func (Plot) GetGroups

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

func (*Plot) GetTextSeries

func (plot *Plot) GetTextSeries(
	ttl int,
	keys []string,
	start,
	end int64,
	search *regexp.Regexp,
	keyset string,
	allowFullFetch bool,
) (TST, uint32, gobol.Error)

func (*Plot) GetTimeSeries

func (plot *Plot) GetTimeSeries(
	ttl int,
	keys []string,
	start,
	end int64,
	opers structs.DataOperations,
	ms,
	keepEmpties,
	allowFullFetch bool,
	keyset string,
) (TS, uint32, gobol.Error)

func (*Plot) ListMeta

func (plot *Plot) ListMeta(keyset, tsType, metric string, tags map[string]string, onlyids bool, size, from int) ([]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) 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) ListNumberTagKeysByMetric

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

ListNumberTagKeysByMetric - returns tag keys filtered by metric

func (*Plot) ListNumberTagValuesByMetric

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

ListNumberTagValuesByMetric - returns tag values filtered by metric

func (*Plot) ListPoints

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

ListPoints - only used on unit tests... must be removed

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

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

ListTextTagKeysByMetric - returns text tag keys filtered by metric

func (*Plot) ListTextTagValuesByMetric

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

ListTextTagValuesByMetric - returns text tag values filtered by metric

func (*Plot) Lookup

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

func (*Plot) MetaFilterOpenTSDB

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

MetaFilterOpenTSDB - creates a metadata query

func (*Plot) MetaOpenTSDB

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

func (*Plot) Query

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

func (*Plot) RawDataQuery

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

RawDataQuery - returns the raw query

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 RateOperation

type RateOperation struct {
	Enabled bool
	Options TSDBrateOptions
}

type RawDataMetadata

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

RawDataMetadata - the raw data (metadata only)

type RawDataNumberPoint

type RawDataNumberPoint struct {
	Timestamp int64   `json:"timestamp"`
	Value     float64 `json:"value"`
}

RawDataNumberPoint - represents a raw number point result

type RawDataQuery

type RawDataQuery struct {
	RawDataMetadata
	Type         string `json:"type"`
	Since        string `json:"since"`
	Until        string `json:"until"`
	EstimateSize bool   `json:"estimateSize"`
}

RawDataQuery - the raw data query JSON

func (*RawDataQuery) Parse

func (rq *RawDataQuery) Parse(r *http.Request) gobol.Error

Parse - parses the bytes tol JSON

type RawDataQueryNumberPoints

type RawDataQueryNumberPoints struct {
	Metadata RawDataMetadata      `json:"metadata"`
	Values   []RawDataNumberPoint `json:"points"`
}

RawDataQueryNumberPoints - the metadata and value results

type RawDataQueryNumberResults

type RawDataQueryNumberResults struct {
	Results []RawDataQueryNumberPoints `json:"results"`
	Total   int                        `json:"total"`
}

RawDataQueryNumberResults - the final raw query number results

type RawDataQueryTextPoints

type RawDataQueryTextPoints struct {
	Metadata RawDataMetadata    `json:"metadata"`
	Texts    []RawDataTextPoint `json:"points"`
}

RawDataQueryTextPoints - the metadata and text results

type RawDataQueryTextResults

type RawDataQueryTextResults struct {
	Results []RawDataQueryTextPoints `json:"results"`
	Total   int                      `json:"total"`
}

RawDataQueryTextResults - the final raw query text results

type RawDataTextPoint

type RawDataTextPoint struct {
	Timestamp int64  `json:"timestamp"`
	Text      string `json:"text"`
}

RawDataTextPoint - represents a raw text point result

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
}

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

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
}

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