diff --git a/go.mod b/go.mod index 8a9903dfa1104..d5da0df59b4bb 100644 --- a/go.mod +++ b/go.mod @@ -118,7 +118,7 @@ require ( github.com/DmitriyVTitov/size v1.5.0 github.com/IBM/go-sdk-core/v5 v5.13.1 github.com/IBM/ibm-cos-sdk-go v1.10.0 - github.com/axiomhq/hyperloglog v0.0.0-20240124082744-24bca3a5b39b + github.com/axiomhq/hyperloglog v0.0.0-20240507144631-af9851f82b27 github.com/buger/jsonparser v1.1.1 github.com/coder/quartz v0.1.0 github.com/d4l3k/messagediff v1.2.1 diff --git a/go.sum b/go.sum index 502a8d2f15daa..b49a73d81aee4 100644 --- a/go.sum +++ b/go.sum @@ -383,8 +383,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.16.1 h1:xsOtPAvHqhvQvBza5ohaUcfq1Lce github.com/aws/aws-sdk-go-v2/service/sts v1.16.1/go.mod h1:Aq2/Qggh2oemSfyHH+EO4UBbgWG6zFCXLHYI4ILTY7w= github.com/aws/smithy-go v1.11.1 h1:IQ+lPZVkSM3FRtyaDox41R8YS6iwPMYIreejOgPW49g= github.com/aws/smithy-go v1.11.1/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= -github.com/axiomhq/hyperloglog v0.0.0-20240124082744-24bca3a5b39b h1:F3yMzKumBUQ6Fn0sYI1YQ16vQRucpZOfBQ9HXWl5+XI= -github.com/axiomhq/hyperloglog v0.0.0-20240124082744-24bca3a5b39b/go.mod h1:k08r+Yj1PRAmuayFiRK6MYuR5Ve4IuZtTfxErMIh0+c= +github.com/axiomhq/hyperloglog v0.0.0-20240507144631-af9851f82b27 h1:60m4tnanN1ctzIu4V3bfCNJ39BiOPSm1gHFlFjTkRE0= +github.com/axiomhq/hyperloglog v0.0.0-20240507144631-af9851f82b27/go.mod h1:k08r+Yj1PRAmuayFiRK6MYuR5Ve4IuZtTfxErMIh0+c= github.com/baidubce/bce-sdk-go v0.9.141 h1:EV5BH5lfymIGPSmYDo9xYdsVlvWAW6nFeiA6t929zBE= github.com/baidubce/bce-sdk-go v0.9.141/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= diff --git a/vendor/github.com/axiomhq/hyperloglog/README.md b/vendor/github.com/axiomhq/hyperloglog/README.md index 00a5614f7eacb..cf5c05e842cab 100644 --- a/vendor/github.com/axiomhq/hyperloglog/README.md +++ b/vendor/github.com/axiomhq/hyperloglog/README.md @@ -44,7 +44,7 @@ Kindly check our [contributing guide](https://github.com/axiomhq/hyperloglog/blo ## License -© Axiom, Inc., 2022 +© Axiom, Inc., 2024 Distributed under MIT License (`The MIT License`). diff --git a/vendor/github.com/axiomhq/hyperloglog/compressed.go b/vendor/github.com/axiomhq/hyperloglog/compressed.go index 4b908be46c3da..d140b88c16cdc 100644 --- a/vendor/github.com/axiomhq/hyperloglog/compressed.go +++ b/vendor/github.com/axiomhq/hyperloglog/compressed.go @@ -103,9 +103,9 @@ func (v *compressedList) UnmarshalBinary(data []byte) error { return nil } -func newCompressedList() *compressedList { +func newCompressedList(capacity int) *compressedList { v := &compressedList{} - v.b = make(variableLengthList, 0) + v.b = make(variableLengthList, 0, capacity) return v } diff --git a/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go b/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go index 826639158e9bb..58a13a5d62872 100644 --- a/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go +++ b/vendor/github.com/axiomhq/hyperloglog/hyperloglog.go @@ -71,7 +71,7 @@ func newSketch(precision uint8, sparse bool) (*Sketch, error) { } if sparse { s.tmpSet = set{} - s.sparseList = newCompressedList() + s.sparseList = newCompressedList(0) } else { s.regs = newRegisters(m) } @@ -253,9 +253,9 @@ func (sk *Sketch) Estimate() uint64 { } if sk.b == 0 { - est = (sk.alpha * m * (m - ez) / (sum + beta(ez))) + est = sk.alpha * m * (m - ez) / (sum + beta(ez)) } else { - est = (sk.alpha * m * m / sum) + est = sk.alpha * m * m / sum } return uint64(est + 0.5) @@ -272,7 +272,7 @@ func (sk *Sketch) mergeSparse() { } sort.Sort(keys) - newList := newCompressedList() + newList := newCompressedList(4*len(sk.tmpSet) + len(sk.sparseList.b)) for iter, i := sk.sparseList.Iter(), 0; iter.HasNext() || i < len(keys); { if !iter.HasNext() { newList.Append(keys[i]) diff --git a/vendor/modules.txt b/vendor/modules.txt index 701241662ea95..c03e1990c9c32 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -464,7 +464,7 @@ github.com/aws/smithy-go/rand github.com/aws/smithy-go/time github.com/aws/smithy-go/transport/http github.com/aws/smithy-go/transport/http/internal/io -# github.com/axiomhq/hyperloglog v0.0.0-20240124082744-24bca3a5b39b +# github.com/axiomhq/hyperloglog v0.0.0-20240507144631-af9851f82b27 ## explicit; go 1.12 github.com/axiomhq/hyperloglog # github.com/baidubce/bce-sdk-go v0.9.141