[Feature][Metrics] Add resource download related metrics for workers#10749
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #10749 +/- ##
============================================
+ Coverage 40.13% 40.19% +0.05%
- Complexity 4843 4844 +1
============================================
Files 940 940
Lines 36945 36982 +37
Branches 4033 4033
============================================
+ Hits 14828 14864 +36
+ Misses 20630 20625 -5
- Partials 1487 1493 +6
Continue to review full report at Codecov.
|
I didn't add a line of UT, not sure why code coverage increased 🤣 . |
dolphinscheduler-meter/src/main/resources/grafana/DolphinSchedulerWorker.json
Outdated
Show resolved
Hide resolved
1580074 to
a4e2bc7
Compare
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/WorkerServerMetrics.java
Outdated
Show resolved
Hide resolved
...worker/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java
Outdated
Show resolved
Hide resolved
dolphinscheduler-meter/src/main/resources/grafana/DolphinSchedulerWorker.json
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/WorkerServerMetrics.java
Outdated
Show resolved
Hide resolved
a4e2bc7 to
a0dfc58
Compare
|
I will submit another PR some time this week to switch to use tags to indicate status instead of putting them in names for all the previous metrics in master and worker. #10867 |
a0dfc58 to
73cd48f
Compare
...ker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/WorkerServerMetrics.java
Outdated
Show resolved
Hide resolved
… download metrics (apache#9324)
7c0d4e1 to
4ec5890
Compare
| public static long getFileSizeInByte(String filename) { | ||
| File file = new File(filename); | ||
| return file.length(); | ||
| } |
There was a problem hiding this comment.
This is one-line code, just inline this util method and remove this method?
new File(filename).length()| WorkerServerMetrics.recordWorkerResourceDownloadSize( | ||
| FileUtils.getFileSizeInByte(execLocalPath + File.separator + fullName)); |
There was a problem hiding this comment.
| WorkerServerMetrics.recordWorkerResourceDownloadSize( | |
| FileUtils.getFileSizeInByte(execLocalPath + File.separator + fullName)); | |
| WorkerServerMetrics.recordWorkerResourceDownloadSize( | |
| Files.size(Paths.get(execLocalPath, fullName))); |
There was a problem hiding this comment.
Pretty and neat! Have fixed it in the latest commit. Thx
5171f34 to
d444411
Compare
|
Kudos, SonarCloud Quality Gate passed! |
|
CI seems somehow not stable today. I've pushed multiple times and it finally passes. |
|
@ruanwenjun @zhongjiajie Could you please take another look when available? Thx~ |
|
Hi @EricGao888 a hint. When merging pull request please take a minute to cleanup/rewrite the commit message so that we can have a more clean git history |
@kezhenxu94 Thanks for the hint! I will follow this guide next time when merging commits https://dolphinscheduler.apache.org/en-us/community/development/commit-message.html |
|
Yes, we need to clean up some messages, |
Thx for the explanation. I will remove those redundant commit msgs next time. : ) |
…pache#10749) * [Feature][Metrics] Add resource download related metrics for workers (apache#9324) * [Feature][Metrics] Fix bugs and add grafana demos for worker resource download metrics (apache#9324) * [Feature][Metrics] Add docs to resource related metrics (apache#9324) * [Feature][Metrics] Use tags to indicate status in metrics (apache#9324) * [Feature][Metrics] Fix demos, docs and remove redundant code (apache#9324) * [Feature][Metrics] Remove .pnpm-debug.log (apache#9324) * [Feature][Metrics] Fix style check (apache#9324) * [Feature][Metrics] Replace KB with bytes for the unit of resource file size in metrics (apache#9324) * [Feature][Metrics] Make code neat (apache#9324)









Purpose of the pull request
Brief change log
Added following metrics:
ds.worker.resource.download.count, sliced by tagstatusds.worker.resource.download.durationds.worker.resource.download.sizeVerify this pull request