|
|
@ -1116,18 +1116,14 @@ func (c cmdable) TopKListWithCount(ctx context.Context, key string) *MapStringIn
|
|
|
|
// Returns OK on success or an error if the operation could not be completed.
|
|
|
|
// Returns OK on success or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.add/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.add/
|
|
|
|
func (c cmdable) TDigestAdd(ctx context.Context, key string, elements ...float64) *StatusCmd {
|
|
|
|
func (c cmdable) TDigestAdd(ctx context.Context, key string, elements ...float64) *StatusCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(elements))
|
|
|
|
args := make([]interface{}, 2+len(elements))
|
|
|
|
args[0] = "TDIGEST.ADD"
|
|
|
|
args[0] = "TDIGEST.ADD"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert floatSlice to []interface{}
|
|
|
|
|
|
|
|
interfaceSlice := make([]interface{}, len(elements))
|
|
|
|
|
|
|
|
for i, v := range elements {
|
|
|
|
for i, v := range elements {
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
args[2+i] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewStatusCmd(ctx, args...)
|
|
|
|
cmd := NewStatusCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
@ -1138,18 +1134,14 @@ func (c cmdable) TDigestAdd(ctx context.Context, key string, elements ...float64
|
|
|
|
// Returns an array of floats representing the values at the specified ranks or an error if the operation could not be completed.
|
|
|
|
// Returns an array of floats representing the values at the specified ranks or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.byrank/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.byrank/
|
|
|
|
func (c cmdable) TDigestByRank(ctx context.Context, key string, rank ...uint64) *FloatSliceCmd {
|
|
|
|
func (c cmdable) TDigestByRank(ctx context.Context, key string, rank ...uint64) *FloatSliceCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(rank))
|
|
|
|
args := make([]interface{}, 2+len(rank))
|
|
|
|
args[0] = "TDIGEST.BYRANK"
|
|
|
|
args[0] = "TDIGEST.BYRANK"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert uint slice to []interface{}
|
|
|
|
for i, r := range rank {
|
|
|
|
interfaceSlice := make([]interface{}, len(rank))
|
|
|
|
args[2+i] = r
|
|
|
|
for i, v := range rank {
|
|
|
|
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
@ -1160,18 +1152,14 @@ func (c cmdable) TDigestByRank(ctx context.Context, key string, rank ...uint64)
|
|
|
|
// Returns an array of floats representing the values at the specified ranks or an error if the operation could not be completed.
|
|
|
|
// Returns an array of floats representing the values at the specified ranks or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.byrevrank/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.byrevrank/
|
|
|
|
func (c cmdable) TDigestByRevRank(ctx context.Context, key string, rank ...uint64) *FloatSliceCmd {
|
|
|
|
func (c cmdable) TDigestByRevRank(ctx context.Context, key string, rank ...uint64) *FloatSliceCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(rank))
|
|
|
|
args := make([]interface{}, 2+len(rank))
|
|
|
|
args[0] = "TDIGEST.BYREVRANK"
|
|
|
|
args[0] = "TDIGEST.BYREVRANK"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert uint slice to []interface{}
|
|
|
|
for i, r := range rank {
|
|
|
|
interfaceSlice := make([]interface{}, len(rank))
|
|
|
|
args[2+i] = r
|
|
|
|
for i, v := range rank {
|
|
|
|
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
@ -1182,18 +1170,14 @@ func (c cmdable) TDigestByRevRank(ctx context.Context, key string, rank ...uint6
|
|
|
|
// Returns an array of floats representing the CDF values for each element or an error if the operation could not be completed.
|
|
|
|
// Returns an array of floats representing the CDF values for each element or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.cdf/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.cdf/
|
|
|
|
func (c cmdable) TDigestCDF(ctx context.Context, key string, elements ...float64) *FloatSliceCmd {
|
|
|
|
func (c cmdable) TDigestCDF(ctx context.Context, key string, elements ...float64) *FloatSliceCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(elements))
|
|
|
|
args := make([]interface{}, 2+len(elements))
|
|
|
|
args[0] = "TDIGEST.CDF"
|
|
|
|
args[0] = "TDIGEST.CDF"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert floatSlice to []interface{}
|
|
|
|
|
|
|
|
interfaceSlice := make([]interface{}, len(elements))
|
|
|
|
|
|
|
|
for i, v := range elements {
|
|
|
|
for i, v := range elements {
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
args[2+i] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
@ -1376,18 +1360,14 @@ func (c cmdable) TDigestMin(ctx context.Context, key string) *FloatCmd {
|
|
|
|
// Returns an array of floats representing the quantile values for each element or an error if the operation could not be completed.
|
|
|
|
// Returns an array of floats representing the quantile values for each element or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.quantile/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.quantile/
|
|
|
|
func (c cmdable) TDigestQuantile(ctx context.Context, key string, elements ...float64) *FloatSliceCmd {
|
|
|
|
func (c cmdable) TDigestQuantile(ctx context.Context, key string, elements ...float64) *FloatSliceCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(elements))
|
|
|
|
args := make([]interface{}, 2+len(elements))
|
|
|
|
args[0] = "TDIGEST.QUANTILE"
|
|
|
|
args[0] = "TDIGEST.QUANTILE"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert floatSlice to []interface{}
|
|
|
|
|
|
|
|
interfaceSlice := make([]interface{}, len(elements))
|
|
|
|
|
|
|
|
for i, v := range elements {
|
|
|
|
for i, v := range elements {
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
args[2+i] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
cmd := NewFloatSliceCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
@ -1398,18 +1378,14 @@ func (c cmdable) TDigestQuantile(ctx context.Context, key string, elements ...fl
|
|
|
|
// Returns an array of integers representing the rank values for each element or an error if the operation could not be completed.
|
|
|
|
// Returns an array of integers representing the rank values for each element or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.rank/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.rank/
|
|
|
|
func (c cmdable) TDigestRank(ctx context.Context, key string, values ...float64) *IntSliceCmd {
|
|
|
|
func (c cmdable) TDigestRank(ctx context.Context, key string, values ...float64) *IntSliceCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(values))
|
|
|
|
args := make([]interface{}, 2+len(values))
|
|
|
|
args[0] = "TDIGEST.RANK"
|
|
|
|
args[0] = "TDIGEST.RANK"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert floatSlice to []interface{}
|
|
|
|
|
|
|
|
interfaceSlice := make([]interface{}, len(values))
|
|
|
|
|
|
|
|
for i, v := range values {
|
|
|
|
for i, v := range values {
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
args[i+2] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewIntSliceCmd(ctx, args...)
|
|
|
|
cmd := NewIntSliceCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
@ -1431,18 +1407,14 @@ func (c cmdable) TDigestReset(ctx context.Context, key string) *StatusCmd {
|
|
|
|
// Returns an array of integers representing the reverse rank values for each element or an error if the operation could not be completed.
|
|
|
|
// Returns an array of integers representing the reverse rank values for each element or an error if the operation could not be completed.
|
|
|
|
// For more information - https://redis.io/commands/tdigest.revrank/
|
|
|
|
// For more information - https://redis.io/commands/tdigest.revrank/
|
|
|
|
func (c cmdable) TDigestRevRank(ctx context.Context, key string, values ...float64) *IntSliceCmd {
|
|
|
|
func (c cmdable) TDigestRevRank(ctx context.Context, key string, values ...float64) *IntSliceCmd {
|
|
|
|
args := make([]interface{}, 2, 2+len(values))
|
|
|
|
args := make([]interface{}, 2+len(values))
|
|
|
|
args[0] = "TDIGEST.REVRANK"
|
|
|
|
args[0] = "TDIGEST.REVRANK"
|
|
|
|
args[1] = key
|
|
|
|
args[1] = key
|
|
|
|
|
|
|
|
|
|
|
|
// Convert floatSlice to []interface{}
|
|
|
|
|
|
|
|
interfaceSlice := make([]interface{}, len(values))
|
|
|
|
|
|
|
|
for i, v := range values {
|
|
|
|
for i, v := range values {
|
|
|
|
interfaceSlice[i] = v
|
|
|
|
args[2+i] = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
args = append(args, interfaceSlice...)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := NewIntSliceCmd(ctx, args...)
|
|
|
|
cmd := NewIntSliceCmd(ctx, args...)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
_ = c(ctx, cmd)
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
|