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

[BEAM-9703] Fix user distribution metric test by not validating namespace. #11455

Merged
merged 3 commits into from
Apr 20, 2020
Merged

[BEAM-9703] Fix user distribution metric test by not validating namespace. #11455

merged 3 commits into from
Apr 20, 2020

Conversation

HuangLED
Copy link
Contributor

@HuangLED HuangLED commented Apr 17, 2020

Previous validation was too strong.

  1. Namespace differs by testing environments (runners). Use contain substring instead in this PR.
  2. min value is too restrictive for streaming case (where the metrics may get reported as best effort)

Alternative way would be to completely disable this test for streaming (and create a dedicated one).


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@HuangLED
Copy link
Contributor Author

R: @tvalentyn, @lukecwik

@lukecwik
Copy link
Member

Please run yapf to fix the python formatting.

@HuangLED
Copy link
Contributor Author

Did run gradlew lint before commit. Looks like yaqf does things slightly different from gradlew-lint.

Now applied "yapf --in-place apache_beam/metrics/metric_test.py". PTAL.

@lukecwik
Copy link
Member

retest this please

name='element_dist',
committed=DistributionMatcher(
sum_value=10, count_value=4, min_value=1, max_value=4))
sum_value=10, count_value=4,
Copy link
Member

Choose a reason for hiding this comment

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

why would min value be >= 0 but the other values be exact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

b/c after repeating it multiple times, streaming side gives consistent outcome on these exact numbers.

After another thought though, given how much uncertainties there are on streaming side, it is really not necessary to put exact number here. And if we do really want to check exact number, there is alternative way to add that separately.

Updated by making all other threes to be 'greater_than(0)'. PTAL.

sum_value=10, count_value=4, min_value=1, max_value=4))
sum_value=hc.greater_than(0),
count_value=hc.greater_than(0),
min_value=hc.greater_than_or_equal_to(0),
Copy link
Member

Choose a reason for hiding this comment

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

Why is min different then the others?

I would expect that the same reason this needs to be >= 0 would be the same reason as the others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough.

My justification was that as long as there is one single update picked up, then other values should be something non-zero. (e.g. count would be at least one).

Maybe I still underestimated how much uncertainties there is.

Updated. Now they are all >=0.

@lukecwik
Copy link
Member

retest this please

1 similar comment
@lukecwik
Copy link
Member

retest this please

@lukecwik lukecwik changed the title Fix user distribution metric test by not validating namespace. [BEAM-9703] Fix user distribution metric test by not validating namespace. Apr 20, 2020
@tvalentyn
Copy link
Contributor

@lukecwik - does latest revision address your comments?

@lukecwik lukecwik merged commit 5acd866 into apache:master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants