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

Upload PerWorkerMetrics every 30 second instead of every 10 seconds #30795

Merged
merged 6 commits into from
Apr 15, 2024

Conversation

JayajP
Copy link
Contributor

@JayajP JayajP commented Mar 28, 2024

Currently PerWorkerMetrics are reported on the WorkerMessages RPC call. By default this RPC is sent every 10 seconds. After this PR we will report PerWorkerMetrics every 30 seconds by extracting/sending these metrics on every 3rd WorkerMessagesRPC.


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

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • 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.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@JayajP JayajP force-pushed the uploadfrequency-v3 branch from bcc3af3 to 0dc2c4b Compare March 28, 2024 22:35
@JayajP JayajP marked this pull request as ready for review March 29, 2024 18:18
@JayajP
Copy link
Contributor Author

JayajP commented Mar 29, 2024

R: @m-trieu

Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

// perWorkerMetricsUpdateFrequency RPC call. If 0, PerWorkerMetrics are not reported.
long perWorkerMetricsUpdateFrequency = 0L;
// Used to track the number of WorkerMessages that have been sent without PerWorkerMetrics.
long workerMessagesIndex = 0L;
Copy link
Contributor

Choose a reason for hiding this comment

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

this will not be threadsafe, how about using an AtomicLong

@@ -81,6 +83,12 @@ public final class StreamingWorkerStatusReporter {
private final ScheduledExecutorService globalWorkerUpdateReporter;
private final ScheduledExecutorService workerMessageReporter;

// PerWorkerMetrics are sent on the WorkerMessages channel, and are sent one in every
// perWorkerMetricsUpdateFrequency RPC call. If 0, PerWorkerMetrics are not reported.
long perWorkerMetricsUpdateFrequency = 0L;
Copy link
Contributor

Choose a reason for hiding this comment

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

if this never changes lets make it private and final and initialize in the constructor

you can modify the constructor to take in this instead of passing it into start() and have start() take no params.

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.47%. Comparing base (96dc16a) to head (0dc2c4b).
Report is 2 commits behind head on master.

❗ Current head 0dc2c4b differs from pull request most recent head 3017996. Consider uploading reports for the commit 3017996 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #30795      +/-   ##
============================================
+ Coverage     70.95%   71.47%   +0.51%     
============================================
  Files          1257      710     -547     
  Lines        140917   104815   -36102     
  Branches       4305        0    -4305     
============================================
- Hits          99989    74915   -25074     
+ Misses        37451    28268    -9183     
+ Partials       3477     1632    -1845     
Flag Coverage Δ
java ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@m-trieu m-trieu left a comment

Choose a reason for hiding this comment

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

LGTM

@JayajP
Copy link
Contributor Author

JayajP commented Apr 11, 2024

Run Java PreCommit

@Abacn Abacn merged commit a00e947 into apache:master Apr 15, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants