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
Fix metric/spans count, add tests for nil entries in the slices #787
Conversation
Codecov Report
@@ Coverage Diff @@
## master #787 +/- ##
==========================================
- Coverage 85.54% 85.49% -0.05%
==========================================
Files 154 153 -1
Lines 11520 11510 -10
==========================================
- Hits 9855 9841 -14
- Misses 1293 1295 +2
- Partials 372 374 +2
Continue to review full report at Codecov.
|
89a07e8
to
7062c01
Compare
if metric.Int64DataPoints().Len() != 0 { | ||
metric.Int64DataPoints().Resize(int64DataPointsNum) | ||
} | ||
if metric.DoubleDataPoints().Len() != 0 { | ||
metric.DoubleDataPoints().Resize(doubleDataPointsNum) | ||
} | ||
if metric.HistogramDataPoints().Len() != 0 { | ||
metric.HistogramDataPoints().Resize(histogramDataPointsNum) | ||
} | ||
if metric.SummaryDataPoints().Len() != 0 { | ||
metric.SummaryDataPoints().Resize(summaryDataPointsNum) | ||
} |
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 don't understand why we have this code. Is it to remove nil data points?
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.
Correct, resize
does init with empty elements, so otherwise if we skipped any element because of nil
we should remove the empty elements from the end of the slice.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
@tigrannajaryan PTAL |
@bogdandrutu Please use the PR description that you create as the commit message as well. I typically copy/paste them when merging, but someone may forget when merging. We want nice commit messages. |
Fixes in this PR:
Work left for slices:
Work left for maps: