plot

package
v0.0.0-...-1b5f0b1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: GPL-3.0 Imports: 26 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 *zap.Logger,
	sts *tsstats.StatsTS,
	cluster *cluster.Cluster,
	es *rubber.Elastic,
	cass *depot.Cassandra,
	bc *bcache.Bcache,
	esIndex string,
	maxTimeseries int,
	maxConcurrentTimeseries int,
	maxConcurrentReads int,
	logQueryTSthreshold int,
) (*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,
	keepEmpties bool,
	search *regexp.Regexp,
) (serie TST, gerr gobol.Error)

func (*Plot) GetTimeSeries

func (plot *Plot) GetTimeSeries(
	keyspace string,
	keys []string,
	start,
	end int64,
	opers structs.DataOperations,
	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) Suggest

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

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  gorilla.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"`
	Query          *structs.TSDBquery `json:"query,omitempty"`
	TSUIDs         []string           `json:"tsuids"`
	Dps            *TSMarshaler       `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 TSMarshaler

type TSMarshaler struct {
	// contains filtered or unexported fields
}

TSMarshaler defines how points are returned by the rest functions

func (*TSMarshaler) MarshalJSON

func (m *TSMarshaler) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface

type TST

type TST struct {
	Count int
	Total int
	Data  depot.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 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