-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: Copy cortex/util/math
into Loki
#5036
Conversation
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
pkg/util/math/rate.go
Outdated
init bool | ||
} | ||
|
||
func NewEWMARate(alpha float64, interval time.Duration) *EwmaRate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used somewhere ? Not sure it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea you are right. Removed it.
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some unwanted spaces under imports sections so can you please fix it?
"github.com/grafana/loki/pkg/util/math" | ||
|
||
"github.com/grafana/loki/pkg/util/spanlogger" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove unwanted spaces here?
Same for some of the other files updated in this PR.
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last 4 changes required, I promise 😬
@@ -9,7 +9,7 @@ import ( | |||
otlog "github.com/opentracing/opentracing-go/log" | |||
"github.com/pkg/errors" | |||
|
|||
"github.com/cortexproject/cortex/pkg/util/math" | |||
"github.com/grafana/loki/pkg/util/math" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more here. Sorry for being picky, we would miss fixing it until we start working on it again.
pkg/storage/chunk/util/util.go
Outdated
@@ -9,7 +9,7 @@ import ( | |||
|
|||
ot "github.com/opentracing/opentracing-go" | |||
|
|||
"github.com/cortexproject/cortex/pkg/util/math" | |||
"github.com/grafana/loki/pkg/util/math" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -7,7 +7,7 @@ import ( | |||
"github.com/stretchr/testify/require" | |||
"google.golang.org/grpc" | |||
|
|||
util_math "github.com/cortexproject/cortex/pkg/util/math" | |||
util_math "github.com/grafana/loki/pkg/util/math" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -5,7 +5,7 @@ import ( | |||
"sync" | |||
"unsafe" | |||
|
|||
util_math "github.com/cortexproject/cortex/pkg/util/math" | |||
util_math "github.com/grafana/loki/pkg/util/math" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Fixed the spacing issue @sandeepsukhani. Thanks for the catch :) (thought |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks Kavi for taking care of changes!
What this PR does / why we need it:
Copy the
cortex/util/math
dependency into Loki.Also moved some helpers from
util/math.go
->util/math
package.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CHANGELOG.md
about the changes.