mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
added ddsketch permalink (#5775)
Co-authored-by: Andrew Chubatiuk <andrew.chubatiuk@motional.com>
This commit is contained in:
parent
e78e5ccfaa
commit
07213f4e0c
1 changed files with 1 additions and 6 deletions
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// TODO: @AndrewChubatiuk, please provide a permalink for the original source code where these constants were extracted
|
// https://github.com/DataDog/opentelemetry-mapping-go/blob/48d52eeea60d28da2e14c154a24557c4d290c6e2/pkg/quantile/config.go
|
||||||
epsillon = 1.0 / 128
|
epsillon = 1.0 / 128
|
||||||
gamma = 1 + 2*epsillon
|
gamma = 1 + 2*epsillon
|
||||||
gammaLn = math.Log(gamma)
|
gammaLn = math.Log(gamma)
|
||||||
|
@ -313,9 +313,6 @@ func (d *Dogsketch) valueForQuantile(q float64) float64 {
|
||||||
vLow := f64(ks[i])
|
vLow := f64(ks[i])
|
||||||
vHigh := vLow * gamma
|
vHigh := vLow * gamma
|
||||||
switch i {
|
switch i {
|
||||||
// TODO: I'm unsure this code is correct. i cannot equal len(ns) in this loop.
|
|
||||||
// @AndrewChubatiuk, please add a permalink to the original source code, which was used
|
|
||||||
// for writing this code, in the comments to this function.
|
|
||||||
case len(ns):
|
case len(ns):
|
||||||
vHigh = d.Max
|
vHigh = d.Max
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -330,8 +327,6 @@ func f64(k int32) float64 {
|
||||||
switch {
|
switch {
|
||||||
case k < 0:
|
case k < 0:
|
||||||
return -f64(-k)
|
return -f64(-k)
|
||||||
// TODO: I'm unsure this logic is correct, since k can be smaller than math.MinInt16 and bigger than math.MaxInt16
|
|
||||||
// @AndrewChubatiuk, please add a permalink to the original source code, which was used for writing this code.
|
|
||||||
case k == math.MaxInt16 || k == math.MinInt16:
|
case k == math.MaxInt16 || k == math.MinInt16:
|
||||||
return math.Inf(int(k))
|
return math.Inf(int(k))
|
||||||
case k == 0:
|
case k == 0:
|
||||||
|
|
Loading…
Reference in a new issue