Skip to content

[BEAM-4775] Metrics improvements: make wordcount.py work with attempted metrics - #7656

Merged
mxm merged 3 commits into
apache:masterfrom
ryan-williams:metrics-fixes
Jan 31, 2019
Merged

mxm merged 3 commits into
apache:masterfrom
ryan-williams:metrics-fixes

Conversation

@ryan-williams

Copy link
Copy Markdown
Contributor

also add some toStrings for Metrics-related classes that have been useful for debugging/logging, and fixes some comment typos that slipped in in #7621.

These were pulled out of #7641 to try to keep it simpler

R: @tweise, @mxm

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java 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
--- --- --- ---

"""Short-hand for falling back to attempted metrics if it seems that
committed was not populated (e.g. due to not being supported on a given
runner"""
return self.committed if self.committed else self.attempted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stupid question: What is the difference between the two?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is a good question!

I believe "committed" consists only of updates from task-attempts that succeeded, whereas "attempted" contains cumulative updates from all task-attempts; this comment in MetricResult is somewhat canonical. I think this is the original design doc about it, though I think it's out of date now.

Flink only supports "attempted" metrics (in Beam; maybe in general?); here's an example where it only fetches "attempted" metric updates. If you have thoughts about the necessity of this restriction from a Flink PoV I'd love to hear them!

A confusing thing is that MetricContainerImpl discusses "commit"s to MetricCells but I don't think it's referring to the same thing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for clarifying. Flink does not support committed metrics per se, though it looks like you could work around this by changing the metrics template to include the execution attempt id.

"""Short-hand for falling back to attempted metrics if it seems that
committed was not populated (e.g. due to not being supported on a given
runner"""
return self.committed if self.committed else self.attempted

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for clarifying. Flink does not support committed metrics per se, though it looks like you could work around this by changing the metrics template to include the execution attempt id.

@mxm
mxm merged commit d0dfa97 into apache:master Jan 31, 2019
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.

2 participants