Skip to content

[Improvement][Metrics] Add metrics for alert server#11240

Merged
EricGao888 merged 8 commits intoapache:devfrom
EricGao888:Fix-11131
Aug 3, 2022
Merged

[Improvement][Metrics] Add metrics for alert server#11240
EricGao888 merged 8 commits intoapache:devfrom
EricGao888:Fix-11131

Conversation

@EricGao888
Copy link
Copy Markdown
Member

@EricGao888 EricGao888 commented Aug 1, 2022

Purpose of the pull request

Brief change log

  • Added metrics for alert server.

Verify this pull request

  • Verified by manual tests.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 2, 2022

Codecov Report

Merging #11240 (30e45ac) into dev (01fc6c8) will increase coverage by 0.04%.
The diff coverage is 36.95%.

❗ Current head 30e45ac differs from pull request most recent head fc0d6b9. Consider uploading reports for the commit fc0d6b9 to get more accurate results

@@             Coverage Diff              @@
##                dev   #11240      +/-   ##
============================================
+ Coverage     40.18%   40.22%   +0.04%     
+ Complexity     4951     4838     -113     
============================================
  Files           988      974      -14     
  Lines         37712    37315     -397     
  Branches       4145     4141       -4     
============================================
- Hits          15153    15010     -143     
+ Misses        21020    20763     -257     
- Partials       1539     1542       +3     
Impacted Files Coverage Δ
...che/dolphinscheduler/alert/AlertServerMetrics.java 0.00% <0.00%> (ø)
...pache/dolphinscheduler/common/enums/AlertType.java 0.00% <0.00%> (ø)
...ler/server/master/metrics/MasterServerMetrics.java 0.00% <0.00%> (ø)
...inscheduler/service/alert/ProcessAlertManager.java 42.60% <0.00%> (-2.64%) ⬇️
...duler/plugin/task/api/AbstractCommandExecutor.java 0.00% <0.00%> (ø)
...inscheduler/server/worker/metrics/TaskMetrics.java 0.00% <0.00%> (ø)
...che/dolphinscheduler/alert/AlertSenderService.java 50.73% <50.00%> (-4.67%) ⬇️
...java/org/apache/dolphinscheduler/dao/AlertDao.java 30.70% <50.00%> (-0.75%) ⬇️
.../server/master/runner/WorkflowExecuteRunnable.java 8.06% <50.00%> (+0.26%) ⬆️
...ler/server/worker/metrics/WorkerServerMetrics.java 74.46% <66.66%> (+1.55%) ⬆️
... and 59 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@EricGao888 EricGao888 marked this pull request as ready for review August 2, 2022 07:37
@EricGao888
Copy link
Copy Markdown
Member Author

Coverage seems 0% for this PR, I'm not sure whether it is meaningful to find a way to cover those metrics related code.

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs Vulnerability A 0 Vulnerabilities Security Hotspot A 0 Security Hotspots Code Smell A 0 Code Smells

0.0% 0.0% Coverage 0.0% 0.0% Duplication

kezhenxu94
kezhenxu94 previously approved these changes Aug 2, 2022
public final class AlertServerMetrics {

private AlertServerMetrics() {
throw new UnsupportedOperationException("Utility class");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use @UtilityClass annotation in this class to reduce these boilerplate codes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, thx for the suggestion. Will update it.

Copy link
Copy Markdown
Member Author

@EricGao888 EricGao888 Aug 2, 2022

Choose a reason for hiding this comment

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

Besides constructors, it looks like @UtilityClass automatically marks all fields and methods in the class as static final. Should we remove all of them during refactoring? Or keep those static final along with @UtilityClass for readability?
https://projectlombok.org/features/experimental/UtilityClass
WDYT @kezhenxu94

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer to remove them. Utility class annotation takes care of all the conventions of a utility class

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Aug 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

41.5% 41.5% Coverage
0.0% 0.0% Duplication

@EricGao888
Copy link
Copy Markdown
Member Author

@kezhenxu94 @ruanwenjun Could you please take another look when available? Thanks~

@EricGao888 EricGao888 merged commit 9ca1eb9 into apache:dev Aug 3, 2022
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.

[Improvement][Metrics] Add metrics for alert server

4 participants