Skip to content

Refactor chunks-to-matrix code and its deps #80

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

Merged
merged 1 commit into from
Nov 1, 2016
Merged

Conversation

juliusv
Copy link
Contributor

@juliusv juliusv commented Oct 31, 2016

As promised in #78...

This also gets rid of any sort.Sort usage for merging&sorting incoming samples, which should be ok if we can assume that the samples in any chunks we read (as well as data from the ingesters) are already sorted. Then we just merge their samples together linearly, which includes deduplication.

Since MergeSamples is now being used by different packages and there was no natural other home for it, I started a util package.

@juliusv juliusv force-pushed the refactor-matrix-code branch from 536f28d to 46e68c6 Compare October 31, 2016 18:19
return nil, err
}

ss.Values = util.MergeSamples(ss.Values, samples)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging lots of small lists into a large list will be n^2 in the worse case; ideally we'd to a merge-sort style tree merge. Not need to do it now, but file a ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, could become a problem if we have many chunks for the same series. I filed #81

@tomwilkie
Copy link
Contributor

LGTM!

@juliusv juliusv merged commit 6b515bc into master Nov 1, 2016
@juliusv juliusv deleted the refactor-matrix-code branch November 1, 2016 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants