Documentation
¶
Index ¶
- Constants
- Variables
- func AddCounterArgs(key string, timestamp int64, value float64, options CreateOptions) (redis.Args, error)
- func MakeStringPtr(s string) *string
- func ParseLabels(res interface{}) (labels map[string]string, err error)
- type AggregationType
- type Client
- func (client *Client) Add(key string, timestamp int64, value float64) (storedTimestamp int64, err error)
- func (client *Client) AddAutoTs(key string, value float64) (storedTimestamp int64, err error)
- func (client *Client) AddAutoTsWithOptions(key string, value float64, options CreateOptions) (storedTimestamp int64, err error)
- func (client *Client) AddWithOptions(key string, timestamp int64, value float64, options CreateOptions) (storedTimestamp int64, err error)
- func (client *Client) AddWithRetention(key string, timestamp int64, value float64, duration int64) (storedTimestamp int64, err error)
- func (client *Client) AggMultiRange(fromTimestamp int64, toTimestamp int64, aggType AggregationType, ...) (ranges []Range, err error)
- func (client *Client) AggRange(key string, fromTimestamp int64, toTimestamp int64, aggType AggregationType, ...) (dataPoints []DataPoint, err error)
- func (client *Client) AlterKeyWithOptions(key string, options CreateOptions) (err error)
- func (client *Client) CreateKey(key string, retentionTime time.Duration) (err error)
- func (client *Client) CreateKeyWithOptions(key string, options CreateOptions) (err error)
- func (client *Client) CreateRule(sourceKey string, aggType AggregationType, bucketSizeMSec uint, ...) (err error)
- func (client *Client) DecrBy(key string, timestamp int64, value float64, options CreateOptions) (int64, error)
- func (client *Client) DeleteRule(sourceKey string, destinationKey string) (err error)
- func (client *Client) Get(key string) (dataPoint *DataPoint, err error)
- func (client *Client) IncrBy(key string, timestamp int64, value float64, options CreateOptions) (int64, error)
- func (client *Client) Info(key string) (res KeyInfo, err error)
- func (client *Client) MultiAdd(samples ...Sample) (timestamps []interface{}, err error)
- func (client *Client) MultiGet(filters ...string) (ranges []Range, err error)
- func (client *Client) MultiGetWithOptions(multiGetOptions MultiGetOptions, filters ...string) (ranges []Range, err error)
- func (client *Client) MultiRangeWithOptions(fromTimestamp int64, toTimestamp int64, mrangeOptions MultiRangeOptions, ...) (ranges []Range, err error)
- func (client *Client) MultiReverseRangeWithOptions(fromTimestamp int64, toTimestamp int64, mrangeOptions MultiRangeOptions, ...) (ranges []Range, err error)
- func (client *Client) QueryIndex(filters ...string) (keys []string, err error)
- func (client *Client) Range(key string, fromTimestamp int64, toTimestamp int64) (dataPoints []DataPoint, err error)
- func (client *Client) RangeWithOptions(key string, fromTimestamp int64, toTimestamp int64, rangeOptions RangeOptions) (dataPoints []DataPoint, err error)
- func (client *Client) ReverseRangeWithOptions(key string, fromTimestamp int64, toTimestamp int64, rangeOptions RangeOptions) (dataPoints []DataPoint, err error)
- type ConnPool
- type CreateOptions
- type DataPoint
- type KeyInfo
- type MultiGetOptions
- type MultiHostPool
- type MultiRangeOptions
- type Range
- type RangeOptions
- type Rule
- type Sample
- type SingleHostPool
Examples ¶
Constants ¶
const TimeRangeFull = int64(-1)
const TimeRangeMaximum = math.MaxInt64
const TimeRangeMinimum = 0
Variables ¶
var DefaultCreateOptions = CreateOptions{ Uncompressed: false, RetentionMSecs: 0, Labels: map[string]string{}, }
var DefaultMultiGetOptions = MultiGetOptions{ WithLabels: false, }
MultiGetOptions are the default options for querying across multiple time-series
var DefaultMultiRangeOptions = MultiRangeOptions{ AggType: "", TimeBucket: -1, Count: -1, WithLabels: false, }
MultiRangeOptions are the default options for querying across multiple time-series
var DefaultRangeOptions = *NewRangeOptions()
DefaultRangeOptions are the default options for querying across a time-series range
Functions ¶
func AddCounterArgs ¶ added in v1.3.0
func AddCounterArgs(key string, timestamp int64, value float64, options CreateOptions) (redis.Args, error)
Add counter args for command TS.INCRBY/TS.DECRBY
func MakeStringPtr ¶
Helper function to create a string pointer from a string literal. Useful for calls to NewClient with an auth pass that is known at compile time.
func ParseLabels ¶ added in v1.2.0
Types ¶
type AggregationType ¶
type AggregationType string
const ( AvgAggregation AggregationType = "AVG" SumAggregation AggregationType = "SUM" MinAggregation AggregationType = "MIN" MaxAggregation AggregationType = "MAX" CountAggregation AggregationType = "COUNT" FirstAggregation AggregationType = "FIRST" LastAggregation AggregationType = "LAST" StdPAggregation AggregationType = "STD.P" StdSAggregation AggregationType = "STD.S" VarPAggregation AggregationType = "VAR.P" VarSAggregation AggregationType = "VAR.S" )
type Client ¶
Client is an interface to time series redis commands
func NewClient ¶
NewClient creates a new client connecting to the redis host, and using the given name as key prefix. Addr can be a single host:port pair, or a comma separated list of host:port,host:port... In the case of multiple hosts we create a multi-pool and select connections at random
func NewClientFromPool ¶ added in v1.3.0
NewClientFromPool creates a new Client with the given pool and client name
Example ¶
exemplifies the NewClientFromPool function
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") client.Add("ts", 1, 5) datapoints, _ := client.RangeWithOptions("ts", 0, 1000, redistimeseries.DefaultRangeOptions) fmt.Println(datapoints[0]) }
Output: {1 5}
func (*Client) Add ¶
func (client *Client) Add(key string, timestamp int64, value float64) (storedTimestamp int64, err error)
Add - Append (or create and append) a new sample to the series args: key - time series key name timestamp - time of value value - value
func (*Client) AddAutoTs ¶ added in v1.2.0
AddAutoTs - Append (or create and append) a new sample to the series, with DB automatic timestamp (using the system clock) args: key - time series key name value - value
func (*Client) AddAutoTsWithOptions ¶ added in v1.2.0
func (client *Client) AddAutoTsWithOptions(key string, value float64, options CreateOptions) (storedTimestamp int64, err error)
AddAutoTsWithOptions - Append (or create and append) a new sample to the series, with the specified CreateOptions and DB automatic timestamp (using the system clock) args: key - time series key name value - value options - define options for create key on add
func (*Client) AddWithOptions ¶ added in v0.3.0
func (client *Client) AddWithOptions(key string, timestamp int64, value float64, options CreateOptions) (storedTimestamp int64, err error)
AddWithOptions - Append (or create and append) a new sample to the series, with the specified CreateOptions args: key - time series key name timestamp - time of value value - value options - define options for create key on add
func (*Client) AddWithRetention ¶ added in v0.3.0
func (client *Client) AddWithRetention(key string, timestamp int64, value float64, duration int64) (storedTimestamp int64, err error)
AddWithRetention - append a new value to the series with a duration args: key - time series key name timestamp - time of value value - value duration - value Deprecated: This function has been deprecated, use AddWithOptions instead
func (*Client) AggMultiRange ¶ added in v0.3.0
func (client *Client) AggMultiRange(fromTimestamp int64, toTimestamp int64, aggType AggregationType, bucketSizeSec int, filters ...string) (ranges []Range, err error)
AggMultiRange - Query a timestamp range across multiple time-series by filters. args: fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. aggType - aggregation type bucketSizeSec - time bucket for aggregation filters - list of filters e.g. "a=bb", "b!=aa" Deprecated: This function has been deprecated, use MultiRangeWithOptions instead
func (*Client) AggRange ¶
func (client *Client) AggRange(key string, fromTimestamp int64, toTimestamp int64, aggType AggregationType, bucketSizeSec int) (dataPoints []DataPoint, err error)
AggRange - aggregation over a ranged query args: key - time series key name fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. aggType - aggregation type bucketSizeSec - time bucket for aggregation Deprecated: This function has been deprecated, use RangeWithOptions instead
func (*Client) AlterKeyWithOptions ¶ added in v1.3.0
func (client *Client) AlterKeyWithOptions(key string, options CreateOptions) (err error)
Update the retention, labels of an existing key. The parameters are the same as TS.CREATE.
func (*Client) CreateKey ¶
CreateKey create a new time-series Deprecated: This function has been deprecated, use CreateKeyWithOptions instead
func (*Client) CreateKeyWithOptions ¶ added in v0.3.0
func (client *Client) CreateKeyWithOptions(key string, options CreateOptions) (err error)
func (*Client) CreateRule ¶
func (client *Client) CreateRule(sourceKey string, aggType AggregationType, bucketSizeMSec uint, destinationKey string) (err error)
CreateRule - create a compaction rule args: sourceKey - key name for source time series aggType - AggregationType bucketSizeMSec - Time bucket for aggregation in milliseconds destinationKey - key name for destination time series
func (*Client) DecrBy ¶ added in v1.3.0
func (client *Client) DecrBy(key string, timestamp int64, value float64, options CreateOptions) (int64, error)
Creates a new sample that decrements the latest sample's value
func (*Client) DeleteRule ¶
DeleteRule - delete a compaction rule args: sourceKey - key name for source time series destinationKey - key name for destination time series
func (*Client) Get ¶ added in v1.2.0
Get - Get the last sample of a time-series. args: key - time-series key name
func (*Client) IncrBy ¶ added in v1.3.0
func (client *Client) IncrBy(key string, timestamp int64, value float64, options CreateOptions) (int64, error)
Creates a new sample that increments the latest sample's value
func (*Client) Info ¶
Returns information and statistics on the time-series. args: key - time-series key name
func (*Client) MultiAdd ¶ added in v1.3.0
Append new samples to a list of series.
Example ¶
Exemplifies the usage of MultiAdd.
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" "log" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") labels1 := map[string]string{ "machine": "machine-1", "az": "us-east-1", } labels2 := map[string]string{ "machine": "machine-2", "az": "us-east-1", } err := client.CreateKeyWithOptions("timeserie-1", redistimeseries.CreateOptions{Labels: labels1}) if err != nil { log.Fatal(err) } err = client.CreateKeyWithOptions("timeserie-2", redistimeseries.CreateOptions{Labels: labels2}) if err != nil { log.Fatal(err) } // Adding multiple datapoints to multiple series datapoints := []redistimeseries.Sample{ {"timeserie-1", redistimeseries.DataPoint{1, 10.5}}, {"timeserie-1", redistimeseries.DataPoint{2, 40.5}}, {"timeserie-2", redistimeseries.DataPoint{1, 60.5}}, } timestamps, err := client.MultiAdd(datapoints...) fmt.Println(fmt.Sprintf("Example adding multiple datapoints to multiple series. Added timestamps: %v", timestamps)) // Adding multiple datapoints to the same serie datapointsSameSerie := []redistimeseries.Sample{ {"timeserie-1", redistimeseries.DataPoint{3, 10.5}}, {"timeserie-1", redistimeseries.DataPoint{4, 40.5}}, {"timeserie-1", redistimeseries.DataPoint{5, 60.5}}, } timestampsSameSerie, err := client.MultiAdd(datapointsSameSerie...) fmt.Println(fmt.Sprintf("Example of adding multiple datapoints to the same serie. Added timestamps: %v", timestampsSameSerie)) }
Output: Example adding multiple datapoints to multiple series. Added timestamps: [1 2 1] Example of adding multiple datapoints to the same serie. Added timestamps: [3 4 5]
func (*Client) MultiGet ¶ added in v1.2.0
MultiGet - Get the last sample across multiple time-series, matching the specific filters. args: filters - list of filters e.g. "a=bb", "b!=aa"
func (*Client) MultiGetWithOptions ¶ added in v1.3.0
func (client *Client) MultiGetWithOptions(multiGetOptions MultiGetOptions, filters ...string) (ranges []Range, err error)
MultiGetWithOptions - Get the last samples matching the specific filters. args: multiGetOptions - MultiGetOptions options. You can use the default DefaultMultiGetOptions filters - list of filters e.g. "a=bb", "b!=aa"
Example ¶
Exemplifies the usage of MultiGetWithOptions function while using the default MultiGetOptions and while using user defined MultiGetOptions.
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") labels1 := map[string]string{ "machine": "machine-1", "az": "us-east-1", } client.AddWithOptions("time-serie-1", 2, 1.0, redistimeseries.CreateOptions{Labels: labels1}) client.Add("time-serie-1", 4, 2.0) labels2 := map[string]string{ "machine": "machine-2", "az": "us-east-1", } client.AddWithOptions("time-serie-2", 1, 5.0, redistimeseries.CreateOptions{Labels: labels2}) client.Add("time-serie-2", 4, 10.0) ranges, _ := client.MultiGetWithOptions(redistimeseries.DefaultMultiGetOptions, "az=us-east-1") rangesWithLabels, _ := client.MultiGetWithOptions(*redistimeseries.NewMultiGetOptions().SetWithLabels(true), "az=us-east-1") fmt.Println(fmt.Sprintf("Ranges: %v", ranges)) fmt.Println(fmt.Sprintf("Ranges with labels: %v", rangesWithLabels)) }
Output: Ranges: [{time-serie-1 map[] [{4 2}]} {time-serie-2 map[] [{4 10}]}] Ranges with labels: [{time-serie-1 map[az:us-east-1 machine:machine-1] [{4 2}]} {time-serie-2 map[az:us-east-1 machine:machine-2] [{4 10}]}]
func (*Client) MultiRangeWithOptions ¶ added in v1.2.0
func (client *Client) MultiRangeWithOptions(fromTimestamp int64, toTimestamp int64, mrangeOptions MultiRangeOptions, filters ...string) (ranges []Range, err error)
MultiRangeWithOptions - Query a timestamp range across multiple time-series by filters. args: fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. mrangeOptions - MultiRangeOptions options. You can use the default DefaultMultiRangeOptions filters - list of filters e.g. "a=bb", "b!=aa"
Example ¶
Exemplifies the usage of MultiRangeWithOptions function.
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") labels1 := map[string]string{ "machine": "machine-1", "az": "us-east-1", } client.AddWithOptions("time-serie-1", 2, 1.0, redistimeseries.CreateOptions{Labels: labels1}) client.Add("time-serie-1", 4, 2.0) labels2 := map[string]string{ "machine": "machine-2", "az": "us-east-1", } client.AddWithOptions("time-serie-2", 1, 5.0, redistimeseries.CreateOptions{Labels: labels2}) client.Add("time-serie-2", 4, 10.0) ranges, _ := client.MultiRangeWithOptions(1, 10, redistimeseries.DefaultMultiRangeOptions, "az=us-east-1") fmt.Println(fmt.Sprintf("Ranges: %v", ranges)) }
Output: Ranges: [{time-serie-1 map[] [{2 1} {4 2}]} {time-serie-2 map[] [{1 5} {4 10}]}]
func (*Client) MultiReverseRangeWithOptions ¶ added in v1.4.0
func (client *Client) MultiReverseRangeWithOptions(fromTimestamp int64, toTimestamp int64, mrangeOptions MultiRangeOptions, filters ...string) (ranges []Range, err error)
MultiReverseRangeWithOptions - Query a timestamp range across multiple time-series by filters, in reverse direction. args: fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. mrangeOptions - MultiRangeOptions options. You can use the default DefaultMultiRangeOptions filters - list of filters e.g. "a=bb", "b!=aa"
Example ¶
Exemplifies the usage of MultiReverseRangeWithOptions function.
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") labels1 := map[string]string{ "machine": "machine-1", "az": "us-east-1", } client.AddWithOptions("time-serie-1", 2, 1.0, redistimeseries.CreateOptions{Labels: labels1}) client.Add("time-serie-1", 4, 2.0) labels2 := map[string]string{ "machine": "machine-2", "az": "us-east-1", } client.AddWithOptions("time-serie-2", 1, 5.0, redistimeseries.CreateOptions{Labels: labels2}) client.Add("time-serie-2", 4, 10.0) ranges, _ := client.MultiReverseRangeWithOptions(1, 10, redistimeseries.DefaultMultiRangeOptions, "az=us-east-1") fmt.Println(fmt.Sprintf("Ranges: %v", ranges)) }
Output: Ranges: [{time-serie-1 map[] [{4 2} {2 1}]} {time-serie-2 map[] [{4 10} {1 5}]}]
func (*Client) QueryIndex ¶ added in v1.3.0
Get all the keys matching the filter list.
func (*Client) Range ¶
func (client *Client) Range(key string, fromTimestamp int64, toTimestamp int64) (dataPoints []DataPoint, err error)
Range - ranged query args: key - time series key name fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. Deprecated: This function has been deprecated, use RangeWithOptions instead
func (*Client) RangeWithOptions ¶ added in v1.2.0
func (client *Client) RangeWithOptions(key string, fromTimestamp int64, toTimestamp int64, rangeOptions RangeOptions) (dataPoints []DataPoint, err error)
RangeWithOptions - Query a timestamp range on a specific time-series args: key - time-series key name fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. rangeOptions - RangeOptions options. You can use the default DefaultRangeOptions
Example ¶
Exemplifies the usage of RangeWithOptions function
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") for ts := 1; ts < 10; ts++ { client.Add("ts", int64(ts), float64(ts)) } datapoints, _ := client.RangeWithOptions("ts", 0, 1000, redistimeseries.DefaultRangeOptions) fmt.Println(fmt.Sprintf("Datapoints: %v", datapoints)) }
Output: Datapoints: [{1 1} {2 2} {3 3} {4 4} {5 5} {6 6} {7 7} {8 8} {9 9}]
func (*Client) ReverseRangeWithOptions ¶ added in v1.4.0
func (client *Client) ReverseRangeWithOptions(key string, fromTimestamp int64, toTimestamp int64, rangeOptions RangeOptions) (dataPoints []DataPoint, err error)
ReverseRangeWithOptions - Query a timestamp range on a specific time-series in reverse order args: key - time-series key name fromTimestamp - start of range. You can use TimeRangeMinimum to express the minimum possible timestamp. toTimestamp - end of range. You can use TimeRangeFull or TimeRangeMaximum to express the maximum possible timestamp. rangeOptions - RangeOptions options. You can use the default DefaultRangeOptions
Example ¶
Exemplifies the usage of ReverseRangeWithOptions function
package main import ( "fmt" redistimeseries "github.com/RedisTimeSeries/redistimeseries-go" "github.com/gomodule/redigo/redis" ) func main() { host := "localhost:6379" password := "" pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", host, redis.DialPassword(password)) }} client := redistimeseries.NewClientFromPool(pool, "ts-client-1") for ts := 1; ts < 10; ts++ { client.Add("ts", int64(ts), float64(ts)) } datapoints, _ := client.ReverseRangeWithOptions("ts", 0, 1000, redistimeseries.DefaultRangeOptions) fmt.Println(fmt.Sprintf("Datapoints: %v", datapoints)) }
Output: Datapoints: [{9 9} {8 8} {7 7} {6 6} {5 5} {4 4} {3 3} {2 2} {1 1}]
type CreateOptions ¶ added in v0.3.0
type CreateOptions struct { Uncompressed bool RetentionMSecs time.Duration Labels map[string]string }
func (*CreateOptions) Serialize ¶ added in v1.2.0
func (options *CreateOptions) Serialize(args []interface{}) (result []interface{}, err error)
Serialize options to args
type DataPoint ¶
func NewDataPoint ¶ added in v1.2.0
func ParseDataPoint ¶ added in v1.2.0
func ParseDataPoints ¶ added in v1.2.0
type KeyInfo ¶
type MultiGetOptions ¶ added in v1.3.0
type MultiGetOptions struct {
WithLabels bool
}
MultiGetOptions represent the options for querying across multiple time-series
func NewMultiGetOptions ¶ added in v1.3.0
func NewMultiGetOptions() *MultiGetOptions
func (*MultiGetOptions) SetWithLabels ¶ added in v1.3.0
func (mgetopts *MultiGetOptions) SetWithLabels(value bool) *MultiGetOptions
type MultiHostPool ¶
func NewMultiHostPool ¶
func NewMultiHostPool(hosts []string, authPass *string) *MultiHostPool
func (*MultiHostPool) Close ¶ added in v1.3.0
func (p *MultiHostPool) Close() (err error)
func (*MultiHostPool) Get ¶
func (p *MultiHostPool) Get() redis.Conn
type MultiRangeOptions ¶ added in v1.2.0
type MultiRangeOptions struct { AggType AggregationType TimeBucket int Count int64 WithLabels bool }
MultiRangeOptions represent the options for querying across multiple time-series
func NewMultiRangeOptions ¶ added in v1.2.0
func NewMultiRangeOptions() *MultiRangeOptions
func (*MultiRangeOptions) SetAggregation ¶ added in v1.2.0
func (mrangeopts *MultiRangeOptions) SetAggregation(aggType AggregationType, timeBucket int) *MultiRangeOptions
func (*MultiRangeOptions) SetCount ¶ added in v1.2.0
func (mrangeopts *MultiRangeOptions) SetCount(count int64) *MultiRangeOptions
func (*MultiRangeOptions) SetWithLabels ¶ added in v1.2.0
func (mrangeopts *MultiRangeOptions) SetWithLabels(value bool) *MultiRangeOptions
type Range ¶ added in v0.3.0
func ParseRanges ¶ added in v1.2.0
func ParseRangesSingleDataPoint ¶ added in v1.2.0
type RangeOptions ¶ added in v1.2.0
type RangeOptions struct { AggType AggregationType TimeBucket int Count int64 }
MultiRangeOptions represent the options for querying across multiple time-series
func NewRangeOptions ¶ added in v1.2.0
func NewRangeOptions() *RangeOptions
func (*RangeOptions) SetAggregation ¶ added in v1.2.0
func (rangeopts *RangeOptions) SetAggregation(aggType AggregationType, timeBucket int) *RangeOptions
func (*RangeOptions) SetCount ¶ added in v1.2.0
func (rangeopts *RangeOptions) SetCount(count int64) *RangeOptions
type Rule ¶
type Rule struct { DestKey string BucketSizeSec int AggType AggregationType }
func ParseRules ¶
type SingleHostPool ¶
func NewSingleHostPool ¶
func NewSingleHostPool(host string, authPass *string) *SingleHostPool