-
Notifications
You must be signed in to change notification settings - Fork 187
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
Network wal pr #1717
Network wal pr #1717
Conversation
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.
Thanks for all this work, I did a first pass but couldn't review everything yet, I will continue the next day
|
||
// By default each sample only has a histogram, float histogram or sample. | ||
if cap(ts.Histograms) == 0 { | ||
ts.Histograms = make([]prompb.Histogram, 1) |
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.
ts.Histograms = make([]prompb.Histogram, 1) | |
ts.Histograms = make([]prompb.Histogram, 0, 1) |
setting the capacity to 1 but the length to 0
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.
I think functionally this is less ideal, since I would need to use append semantics. There will only ever be 0 or 1 record here.
if tsBuf.Histograms.FloatHistogram != nil { | ||
ts.Histograms = ts.Histograms[:1] | ||
ts.Histograms[0] = tsBuf.Histograms.FloatHistogram.ToPromFloatHistogram() | ||
} |
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.
could both cases above simply be appends and the if below could be removed?
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.
Let me think on this.
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.
First pass, didn't go through everything yet.
Co-authored-by: William Dumont <william.dumont@grafana.com>
Co-authored-by: Piotr <17101802+thampiotr@users.noreply.github.com>
Going to merge this and move on to the next PR. |
These are the network items for the new wal. There are some similarities with the old wal, buildWriteRequest and queuing by hash. I have e2e tests that arent shown here, will see if I can distill them to more specific tests but figure we can go ahead and get started looking at the code.