-
Notifications
You must be signed in to change notification settings - Fork 818
Move iterators inside chunk store using MergeSeriesIterator #438
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
Conversation
5497751
to
c171b2e
Compare
93df818
to
454f36c
Compare
Metric: it.Metric().Metric, | ||
Values: it.RangeValues(in), | ||
} | ||
matrix = append(matrix, ss) |
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.
This conversion is a little unfortunate. I think it needs a bit more thought.
pkg/util/iterator.go
Outdated
|
||
for _, it := range msit.iterators { | ||
samplePair := it.ValueAtOrBeforeTime(ts) | ||
timeDifference := absTimeDifference(ts, samplePair.Timestamp) |
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 is this needed?
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.
Just realised that the samplePair timestamp will always be less than the timestamp given. I will remove.
pkg/util/merger.go
Outdated
@@ -27,3 +27,26 @@ func MergeSamples(a, b []model.SamplePair) []model.SamplePair { | |||
} | |||
return result | |||
} | |||
|
|||
// MergeNSamples merges and dedupes n sets of already sorted sample pairs. | |||
func MergeNSamples(sampleSets ...[]model.SamplePair) []model.SamplePair { |
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.
MergeNSamplesSets? And MergeSampleSets above?
pkg/util/merger.go
Outdated
c <- MergeSamples(left, right) | ||
}() | ||
} | ||
return <-c |
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.
Parallelism not necessary here I think.
dda8599
to
4100dcc
Compare
4100dcc
to
596ddda
Compare
Depends on #430 - view changes for this PR here: https://github.com/weaveworks/cortex/pull/438/files/83bb69d02a11ef471aebf9408c6a1f1190a6a9da..c38224c193bafc21fe4e38be72c33117893f2dc6
Part of #416
MergeSeriesIterator
which is created from multiple iterators and implements SeriesIterator.