KsanaDB

package
v0.0.0-...-4a996dc Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BulkSetTimeSeries

func BulkSetTimeSeries(metrics string, input []interface{}) (int, error)

func Close

func Close()

func DeleteMetric

func DeleteMetric(name string) (string, error)

func GetFilterSeq

func GetFilterSeq(name string, filterList []string) ([]string, error)

func GetMetric

func GetMetric() (string, error)

func GetMetricsTag

func GetMetricsTag(name string, target string, keyName string) (string, error)

func InitRedis

func InitRedis(network, address string)

func ParseJson

func ParseJson(data string) ([]interface{}, error)

TODO refactor

func ParseJsonHash

func ParseJsonHash(data string) (int64, float64, []string, error)

func QueryData

func QueryData(q *Query) (string, error)

func QueryTimeSeriesData

func QueryTimeSeriesData(name string, start int64, stop int64, tagFilter []string, groupByTag []string, aggregationFunction string, timeRange int, unit string) (string, error)

func SetData

func SetData(data string) *error

func SetTimeSeries

func SetTimeSeries(metrics string, value string, time int64) (int, error)

Types

type AggregatorType

type AggregatorType struct {
	Name     string
	Sampling Sample
}

type AllTagSeqType

type AllTagSeqType struct {
	Val map[string]string
	Seq map[string][]string
}

func GetMetricsTagSeq

func GetMetricsTagSeq(name string, keyName string) AllTagSeqType

type DataPoint

type DataPoint struct {
	Name       string
	Value      *json.Number
	Tags       map[string]interface{}
	Timestamp  *json.Number
	Datapoints [][]json.Number
}

func ParseDataJson

func ParseDataJson(data string) ([]DataPoint, error)

type GroupType

type GroupType struct {
	Tags   map[string]string `json:"Tags,omitempty"`
	Values [][]interface{}
}

type MetricType

type MetricType struct {
	Tags       map[string]string
	Name       *string
	Limit      *json.Number
	GroupBy    []string
	Aggregator AggregatorType
}

type OutputForm

type OutputForm struct {
	Result ResultType
}

type Query

type Query struct {
	StartAbsolute *json.Number
	EndAbsolute   *json.Number
	StartRelative *RelativeTime
	EndRelative   *RelativeTime
	TimeZone      string
	Metric        MetricType
}

func ParseQueryJson

func ParseQueryJson(data string) (*Query, error)

type RelativeTime

type RelativeTime struct {
	Value *json.Number
	Unit  *string
}

type ResultType

type ResultType struct {
	Name              string
	Start             int64             //json.Number
	End               int64             //json.Number
	Filter            map[string]string `json:"Filter,omitempty"`
	AggregateFunction string
	TimeRange         int
	TimeUnit          string
	GroupBy           []string `json:"GroupBy,omitempty"`
	Group             []GroupType
}

type Sample

type Sample struct {
	Value *json.Number
	Unit  *string
}

Jump to

Keyboard shortcuts

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