You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "ruanwenjun (via GitHub)" <gi...@apache.org> on 2025/01/21 12:06:44 UTC
[PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
ruanwenjun opened a new pull request, #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968
## Purpose of the pull request
close #16903 16903
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
## Verify this pull request
<!--*(Please pick either of the following options)*-->
This pull request is code cleanup without any test coverage.
*(or)*
This pull request is already covered by existing tests, such as *(please describe tests)*.
(or)
This change added tests and can be verified as follows:
<!--*(example:)*
- *Added dolphinscheduler-dao tests for end-to-end.*
- *Added CronUtilsTest to verify the change.*
- *Manually verified the change by testing locally.* -->
(or)
## Pull Request Notice
[Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
If your pull request contains incompatible change, you should also add it to `docs/docs/en/guide/upgrade/incompatible.md`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on code in PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#discussion_r1924943220
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.registry.jdbc;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.commons.lang3.StringUtils;
+
+import lombok.experimental.UtilityClass;
+
+@UtilityClass
+public class KeyUtils {
+
+ /**
+ * Whether the path is the parent path of the child
+ * <p> Only the parentPath is the parent path of the childPath, return true
+ * <p> If the parentPath is equal to the childPath, return false
+ */
+ public static boolean isParent(final String parentPath, final String childPath) {
+ if (StringUtils.isEmpty(parentPath)) {
+ throw new IllegalArgumentException("Invalid parent path string " + parentPath);
+ }
+ if (StringUtils.isEmpty(childPath)) {
+ throw new IllegalArgumentException("Invalid child path string " + childPath);
+ }
+ // 使用"/"分割字符串,判断childPath是否是parentPath的子路径
Review Comment:
Please using english here.
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.registry.jdbc;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.commons.lang3.StringUtils;
+
+import lombok.experimental.UtilityClass;
+
+@UtilityClass
+public class KeyUtils {
+
+ /**
+ * Whether the path is the parent path of the child
+ * <p> Only the parentPath is the parent path of the childPath, return true
+ * <p> If the parentPath is equal to the childPath, return false
+ */
+ public static boolean isParent(final String parentPath, final String childPath) {
+ if (StringUtils.isEmpty(parentPath)) {
+ throw new IllegalArgumentException("Invalid parent path string " + parentPath);
+ }
+ if (StringUtils.isEmpty(childPath)) {
+ throw new IllegalArgumentException("Invalid child path string " + childPath);
+ }
+ // 使用"/"分割字符串,判断childPath是否是parentPath的子路径
+ final String[] parentSplit = parentPath.split("/");
+ final String[] childSplit = childPath.split("/");
+ if (parentSplit.length >= childSplit.length) {
+ return false;
+ }
+ for (int i = 0; i < parentSplit.length; i++) {
+ if (!parentSplit[i].equals(childSplit[i])) {
+ return false;
+ }
+ }
+ return true;
+
+ }
+
+ public static boolean isSamePath(final String path1, final String path2) {
+ return removeLastSlash(path1).equals(path2);
+ }
+
+ private static String removeLastSlash(final String path) {
+ checkNotNull(path, "path is null");
+ if (!path.startsWith("/")) {
+ throw new IllegalArgumentException("Invalid path string " + path);
+ }
+ int length = path.length() - 1;
+ while (length >= 0 && path.charAt(length) == '/') {
+ length--;
+ }
+ if (length == -1) {
+ return "/";
Review Comment:
Using constants instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "zhongjiajie (via GitHub)" <gi...@apache.org>.
zhongjiajie commented on code in PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#discussion_r1926898293
##########
dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/metrics/DefaultMetricsProvider.java:
##########
@@ -74,6 +77,9 @@ public SystemMetrics getSystemMetrics() {
.systemMemoryUsed(totalSystemMemory - systemMemoryAvailable)
.systemMemoryMax(totalSystemMemory)
.systemMemoryUsedPercentage((double) (totalSystemMemory - systemMemoryAvailable) / totalSystemMemory)
+ .diskUsed(diskToTalBytes - diskFreeBytes)
+ .diskTotal(diskToTalBytes)
+ .diskUsedPercentage((diskToTalBytes - diskFreeBytes) / diskToTalBytes)
Review Comment:
nothing but want to make sure we store as float in stock and render as '\d %' right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#issuecomment-2607052125
Please retry analysis of this Pull-Request directly on SonarQube Cloud
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#issuecomment-2604636956
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968) **Quality Gate failed**
Failed conditions
 [40.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_coverage&view=list) (required ≥ 60%)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#issuecomment-2606419660
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [67.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#issuecomment-2604640052
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968) **Quality Gate failed**
Failed conditions
 [40.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_coverage&view=list) (required ≥ 60%)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#discussion_r1925203245
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.registry.jdbc;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.commons.lang3.StringUtils;
+
+import lombok.experimental.UtilityClass;
+
+@UtilityClass
+public class KeyUtils {
+
+ /**
+ * Whether the path is the parent path of the child
+ * <p> Only the parentPath is the parent path of the childPath, return true
+ * <p> If the parentPath is equal to the childPath, return false
+ */
+ public static boolean isParent(final String parentPath, final String childPath) {
+ if (StringUtils.isEmpty(parentPath)) {
+ throw new IllegalArgumentException("Invalid parent path string " + parentPath);
+ }
+ if (StringUtils.isEmpty(childPath)) {
+ throw new IllegalArgumentException("Invalid child path string " + childPath);
+ }
+ // 使用"/"分割字符串,判断childPath是否是parentPath的子路径
Review Comment:
Done
##########
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.registry.jdbc;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.commons.lang3.StringUtils;
+
+import lombok.experimental.UtilityClass;
+
+@UtilityClass
+public class KeyUtils {
+
+ /**
+ * Whether the path is the parent path of the child
+ * <p> Only the parentPath is the parent path of the childPath, return true
+ * <p> If the parentPath is equal to the childPath, return false
+ */
+ public static boolean isParent(final String parentPath, final String childPath) {
+ if (StringUtils.isEmpty(parentPath)) {
+ throw new IllegalArgumentException("Invalid parent path string " + parentPath);
+ }
+ if (StringUtils.isEmpty(childPath)) {
+ throw new IllegalArgumentException("Invalid child path string " + childPath);
+ }
+ // 使用"/"分割字符串,判断childPath是否是parentPath的子路径
+ final String[] parentSplit = parentPath.split("/");
+ final String[] childSplit = childPath.split("/");
+ if (parentSplit.length >= childSplit.length) {
+ return false;
+ }
+ for (int i = 0; i < parentSplit.length; i++) {
+ if (!parentSplit[i].equals(childSplit[i])) {
+ return false;
+ }
+ }
+ return true;
+
+ }
+
+ public static boolean isSamePath(final String path1, final String path2) {
+ return removeLastSlash(path1).equals(path2);
+ }
+
+ private static String removeLastSlash(final String path) {
+ checkNotNull(path, "path is null");
+ if (!path.startsWith("/")) {
+ throw new IllegalArgumentException("Invalid path string " + path);
+ }
+ int length = path.length() - 1;
+ while (length >= 0 && path.charAt(length) == '/') {
+ length--;
+ }
+ if (length == -1) {
+ return "/";
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#issuecomment-2606420027
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [67.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#discussion_r1928003678
##########
dolphinscheduler-meter/src/main/java/org/apache/dolphinscheduler/meter/metrics/DefaultMetricsProvider.java:
##########
@@ -74,6 +77,9 @@ public SystemMetrics getSystemMetrics() {
.systemMemoryUsed(totalSystemMemory - systemMemoryAvailable)
.systemMemoryMax(totalSystemMemory)
.systemMemoryUsedPercentage((double) (totalSystemMemory - systemMemoryAvailable) / totalSystemMemory)
+ .diskUsed(diskToTalBytes - diskFreeBytes)
+ .diskTotal(diskToTalBytes)
+ .diskUsedPercentage((diskToTalBytes - diskFreeBytes) / diskToTalBytes)
Review Comment:
We will render as string by
```
<Gauge
data={(
JSON.parse(item.heartBeatInfo).diskUsage * 100
).toFixed(2)}
/>
```
It works well
<img width="1215" alt="image" src="https://github.com/user-attachments/assets/93593ab9-746e-4df4-8441-21158cf30663" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968#issuecomment-2607051736
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=16968&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [67.1% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=16968&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=16968)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-16903] Fix monitor page cannot display well [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #16968:
URL: https://github.com/apache/dolphinscheduler/pull/16968
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org