Skip to content
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

Fixing tagging on submetrics #609

Merged
merged 4 commits into from
May 3, 2018
Merged

Fixing tagging on submetrics #609

merged 4 commits into from
May 3, 2018

Conversation

luizbafilho
Copy link
Contributor

Fixes #590 by validating that sub metric tags are included in the sample tags.

@codecov-io
Copy link

codecov-io commented Apr 30, 2018

Codecov Report

Merging #609 into master will decrease coverage by <.01%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #609      +/-   ##
==========================================
- Coverage   62.04%   62.03%   -0.01%     
==========================================
  Files          97       97              
  Lines        7501     7510       +9     
==========================================
+ Hits         4654     4659       +5     
- Misses       2589     2593       +4     
  Partials      258      258
Impacted Files Coverage Δ
core/engine.go 89.83% <100%> (+1.06%) ⬆️
stats/stats.go 38.88% <55.55%> (-0.3%) ⬇️
js/modules/k6/metrics/metrics.go 75% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a65fcb8...74583d2. Read the comment docs.

Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

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

LGTM, sorry for breaking this and thanks for fixing it!

stats/stats.go Outdated
if st == other {
return true
}
if st == nil || other == nil || len(st.tags) < len(other.tags) {
Copy link
Member

Choose a reason for hiding this comment

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

Ah, actually, I'm not sure, but I think that if other == nil || len(other.tags) == 0, then we should always return true, since every set contains the empty set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, nil is not an empty set, but if you indeed pass an empty set you will get a true response.

I questioned myself that when implementing, then I went to a Ruby repl and tried something like [1,2,3].includes?(nil) and got false, so I decided to follow the same approach.

Copy link
Member

Choose a reason for hiding this comment

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

I have no idea what ruby does, but in the case of SampleTags, a nil pointer is basically the same as an empty tag set. I'm not very familiar with how tagging of submetrics is supposed to work and if this is the desired behaviour though, just that mathematically the empty set is a subset of all sets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really care about that. Let's make that return true then.

@luizbafilho luizbafilho merged commit 21723fc into master May 3, 2018
@luizbafilho luizbafilho deleted the fix/submetric-tags branch May 3, 2018 16:45
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.

3 participants