Skip to content

[BEAM-8258] basic metric feature for nexmark#12674

Merged
pabloem merged 4 commits intoapache:masterfrom
leiyiz:nexmark_metric_py
Aug 26, 2020
Merged

[BEAM-8258] basic metric feature for nexmark#12674
pabloem merged 4 commits intoapache:masterfrom
leiyiz:nexmark_metric_py

Conversation

@leiyiz
Copy link
Contributor

@leiyiz leiyiz commented Aug 24, 2020

added beam-metric based performance monitoring
performance are logged to console after the query is done or canceled by nexmark suite


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 Dataflow Flink Samza Spark Twister2
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
--- Build Status ---
XLang Build Status --- Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace
Non-portable Build Status Build Status
Build Status
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.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@leiyiz
Copy link
Contributor Author

leiyiz commented Aug 24, 2020

R: @y1chi
R: @pabloem

@codecov
Copy link

codecov bot commented Aug 24, 2020

Codecov Report

Merging #12674 into master will decrease coverage by 0.18%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12674      +/-   ##
==========================================
- Coverage   34.48%   34.29%   -0.19%     
==========================================
  Files         685      696      +11     
  Lines       81519    82307     +788     
  Branches     9185     9300     +115     
==========================================
+ Hits        28109    28228     +119     
- Misses      52987    53656     +669     
  Partials      423      423              
Impacted Files Coverage Δ
typehints/typecheck_test_py3.py 31.54% <0.00%> (-16.00%) ⬇️
typehints/typecheck.py 29.44% <0.00%> (-6.18%) ⬇️
testing/load_tests/load_test_metrics_utils.py 34.98% <0.00%> (-1.39%) ⬇️
runners/worker/opcounters.py 33.81% <0.00%> (-0.87%) ⬇️
pipeline.py 22.04% <0.00%> (-0.28%) ⬇️
dataframe/transforms_test.py 25.00% <0.00%> (-0.21%) ⬇️
io/gcp/bigquery_test.py 27.39% <0.00%> (-0.18%) ⬇️
options/pipeline_options.py 52.99% <0.00%> (-0.16%) ⬇️
transforms/ptransform_test.py 18.37% <0.00%> (-0.09%) ⬇️
transforms/core.py 36.79% <0.00%> (-0.05%) ⬇️
... and 30 more

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 66055db...f7a7ca7. Read the comment docs.

@leiyiz
Copy link
Contributor Author

leiyiz commented Aug 24, 2020

Run Portable_Python PreCommit

Copy link
Member

@pabloem pabloem left a comment

Choose a reason for hiding this comment

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

LGTM. Just one comment about the monitoring DoFn. LMK what you thinka bout that

Comment on lines 51 to 54
def process(self, element):
self.element_count.inc()
self.event_time.update(int(time() * 1000))
yield element
Copy link
Member

Choose a reason for hiding this comment

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

The reason we collect the event_time metric is to know the start and end time of certain processing, right? If so, we only care about the beginning, and the end, right?
Updating metrics are a bit of a slow operation to perform (not incredibly slow, but since this DoFn does nothing else), I think it may be a good idea to perform these updates in finish_bundle and start_bundle (for event_time, update only when the bundle started and ended, and for event_count, you can keep a member variable that counts the number of elements per bundle

e.g.:

start_bundle(self):
  self.element_counter = 0
  self.event_time.update(now)
process(self, elm):
  self.element_counter += 1
  yield elm
finish_bundle(self):
  self.event_time.update(now)
  self.element_count.inc(self.element_counter)

wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think this makes sense, but I think I would need to keep updating some metric in the process method because I made a new metric for logging the timestamp of the events other than the now() metric

Copy link
Member

Choose a reason for hiding this comment

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

I see. In that case, I think then there's not a big gain from using start_bundle and finish_bundle. I'll just approve it for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is a bit confusing between self.event_time and self.event_timestamp, I thought the timestamp was for debugging purpose that should be removed once it's not needed?

Copy link
Member

Choose a reason for hiding this comment

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

@leiyiz thoughts?

Copy link
Contributor

@y1chi y1chi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@pabloem pabloem merged commit f3a8b5c into apache:master Aug 26, 2020
@leiyiz leiyiz deleted the nexmark_metric_py branch August 27, 2020 22:29
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.

3 participants