-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Correctly handle auto downsampling in codec #3073
Conversation
Signed-off-by: Ben Ye <yb532204897@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.
Some suggestions only. LGTM! (:
pkg/queryfrontend/cache_splitter.go
Outdated
|
||
// TODO(yeya24): Add other request params as request key. | ||
// GenerateCacheKey generates a cache key based on the Request and interval. | ||
func (t constSplitter) GenerateCacheKey(_ string, r queryrange.Request) string { | ||
currentInterval := r.GetStart() / time.Duration(t).Milliseconds() | ||
func (t thanosCacheSplitter) GenerateCacheKey(_ string, r queryrange.Request) string { |
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.
It's not splitter anymore, rather cacheKeyGenerator
? (:
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.
Yes, that's better
for _, tc := range []struct { | ||
name string | ||
req queryrange.Request | ||
expectedCacheKey string |
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.
expectedCacheKey string | |
expected string |
pkg/queryfrontend/roundtrip_test.go
Outdated
@@ -300,6 +300,16 @@ func TestRoundTripCacheMiddleware(t *testing.T) { | |||
MaxSourceResolution: 10 * seconds, | |||
} | |||
|
|||
// same query params as testRequest, different maxSourceResolution |
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 we start comments with upper case letter like normal sentence?
pkg/queryfrontend/roundtrip_test.go
Outdated
name: "do it again", | ||
req: testRequest2, | ||
name: "different max source resolution and different level", | ||
req: testRequest4, |
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.
why not inlining those requests maybe?
Signed-off-by: Ben Ye <yb532204897@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!
Thanks!
Signed-off-by: Ben Ye yb532204897@gmail.com
Changes
max_source_resolution=auto
correctly.Verification