-
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
Changes from 4 commits
8b88840
d29501e
0d0467c
82b1b47
5e2bc84
32f86f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
"github.com/grafana/loki/pkg/storage/chunk" | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
"github.com/grafana/loki/pkg/storage/chunk" | ||
) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
"github.com/grafana/loki/pkg/storage/chunk" | ||
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
"github.com/grafana/loki/pkg/storage/chunk" | ||
chunk_util "github.com/grafana/loki/pkg/storage/chunk/util" | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package math | ||
|
||
// Max returns the maximum of two ints | ||
func Max(a, b int) int { | ||
if a > b { | ||
return a | ||
} | ||
return b | ||
} | ||
|
||
// Min returns the minimum of two ints | ||
func Min(a, b int) int { | ||
if a < b { | ||
return a | ||
} | ||
return b | ||
} | ||
|
||
// Max64 returns the maximum of two int64s | ||
func Max64(a, b int64) int64 { | ||
if a > b { | ||
return a | ||
} | ||
return b | ||
} | ||
|
||
// Min64 returns the minimum of two int64s | ||
func Min64(a, b int64) int64 { | ||
if a < b { | ||
return a | ||
} | ||
return b | ||
} | ||
|
||
// MinUint32 return the min of a and b. | ||
func MinUint32(a, b uint32) uint32 { | ||
if a < b { | ||
return a | ||
} | ||
return b | ||
} |
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.