-
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
store: support serving downsampled data from bucket #191
Conversation
a88225b
to
7306c96
Compare
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.
Nice! However, can see some potential bugs here
pkg/store/bucket.go
Outdated
chks []storepb.AggrChunk | ||
set []seriesEntry | ||
i int | ||
// chks []storepb.AggrChunk |
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.
do we need this comment?
pkg/store/bucket.go
Outdated
if err != nil { | ||
return errors.Errorf("aggregate %s does not exist", downsample.AggrSum) | ||
} | ||
out.Count = &storepb.Chunk{Type: storepb.Chunk_XOR, Data: x.Bytes()} |
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.
out.Count
??
Not out.Sum
?
|
||
// getFor returns a time-ordered list of blocks that cover date between mint and maxt. | ||
// Blocks with the lowest resolution possible but not lower than the given resolution are returned. | ||
func (s *bucketBlockSet) getFor(mint, maxt, minResolution int64) (bs []*bucketBlock) { |
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.
how we got from req.MaxResolutionWindow
to this minResolution
name here? Also
for ; i < len(s.resolutions) && s.resolutions[i] > minResolution; i++ {}
Min resolution make sense here, but we are putting max Resolution in this parameter... Not sure what's going on here ^^
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.
That's essentially the issue about intuitively of naming we ran into before. MaxResolutionWindow
and minResolution
are in fact the same thing. If we set an upper bound on how big the window we aggregate over is that implies a minimum resolution we want to guarantee. If we made the window bigger, resolution would decrease.
3ecb602
to
9359c8c
Compare
134d1cc
to
85bb165
Compare
Fixed and added some tests. |
Gave this another review myself. I'll merge this now. There's one remaining comment on the naming confusion. If we come up with a better variant we can always change this later. |
Oke (: |
Is skiing weather so bad that you are on GH instead on 11am :P? |
Build with golang 1.20
@Bplotka
Definitely some tests missing overall – will add some later.