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

Improve cloud aggregation for different URLs #1220

Merged
merged 2 commits into from
Oct 30, 2019
Merged

Improve cloud aggregation for different URLs #1220

merged 2 commits into from
Oct 30, 2019

Conversation

cuonglm
Copy link
Contributor

@cuonglm cuonglm commented Oct 29, 2019

For cloud output, we currently don't aggregate HTTP metrics with
different url tag, but with the same name tag.

This PR improves aggregation by setting url tag to be the same as name
tag. It's not ideal, but seems like the least bad option in term of UX.

Fixes #1166

@cuonglm cuonglm added this to the v0.26.0 milestone Oct 29, 2019
@codecov-io
Copy link

codecov-io commented Oct 29, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@78858ef). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1220   +/-   ##
=========================================
  Coverage          ?   73.77%           
=========================================
  Files             ?      147           
  Lines             ?    10695           
  Branches          ?        0           
=========================================
  Hits              ?     7890           
  Misses            ?     2345           
  Partials          ?      460
Impacted Files Coverage Δ
stats/cloud/collector.go 72.61% <100%> (ø)

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 78858ef...e3912bc. Read the comment docs.

stats/stats.go Outdated Show resolved Hide resolved
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.

Besides the inline comment, you should also actually call sc.ReplaceURLWithName() (or however the method is named) somewhere in here: https://github.com/loadimpact/k6/blob/c2d73ba070b5223d60e784401e9bda8d634440fe/stats/cloud/collector.go#L271-L272

@cuonglm cuonglm requested a review from na-- October 29, 2019 07:20
stats/cloud/data.go Outdated Show resolved Hide resolved
stats/stats.go Outdated Show resolved Hide resolved
@cuonglm cuonglm requested a review from na-- October 29, 2019 08:06
na--
na-- previously approved these changes Oct 29, 2019
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, only squash the commits before merging

stats/stats.go Outdated Show resolved Hide resolved
@cuonglm cuonglm requested a review from na-- October 29, 2019 08:48
na--
na-- previously approved these changes Oct 29, 2019
imiric
imiric previously approved these changes Oct 29, 2019
stats/cloud/collector.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

I would prefer if you either:

  1. copy the whole sample but only if there is
    1.1. url
    1.2. name
    1.3. url != name
  2. don't use the sample's tags but work around them somehow - probably the more perfomant variant but will take more code
  3. shelf this until we have more optimized tags/ metric samples and we can fix it without introducing neither a race condition nor a big perf penalty

@na--
Copy link
Member

na-- commented Oct 29, 2019

@mstoykov, see my inline comment why this isn't problematic from a data race perspective. Rather, the problem is that if you have multiple outputs, the cloud output's url=name replacement could affect metric tags in the other outputs as well, depending on the order they are defined 😞 I'd be fine with that corner case bug, because:

  1. it's not terrible
  2. not a lot of people use multiple outputs
  3. the alternative would involve CPU-heavy things (copying string maps around) in an already performance-sensitive area of code

So I'm for merging this as it is now, and properly fixing it when we implement the better cloud aggregation.

@na--
Copy link
Member

na-- commented Oct 29, 2019

Hmm although the performance overhead of copying the maps around wouldn't be too terrible, given the fact that we'd only do it if name != url...

@na-- na-- self-requested a review October 29, 2019 10:24
For cloud output, we currently don't aggregate HTTP metrics with
different url tag, but with the same name tag.

This PR improves aggregation by setting url tag to be the same as name
tag. It's not ideal, but seems like the least bad option in term of UX.

Fixes #1166
@cuonglm cuonglm requested a review from na-- October 29, 2019 15:45
@cuonglm cuonglm merged commit a948b4d into master Oct 30, 2019
@cuonglm cuonglm deleted the feature/1166 branch October 30, 2019 10:31
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.

Improve cloud aggregation for different URLs with the same name tag
5 participants