You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/01/10 02:46:47 UTC

[GitHub] [skywalking] dkkb opened a new pull request #8398: `AnalyzerModuleConfig` code improvement.

dkkb opened a new pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398


   Change the type of `virtualPeers` to `Set<Integer>` and and `final` to `noUpstreamRealAddressAgents` field.
   
   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/CHANGES.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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780871733



##########
File path: CHANGES.md
##########
@@ -23,6 +23,7 @@ Release Notes.
 * Upgrade H2 version to 2.0.202 to fix CVE-2021-23463.
 * Extend column name override mechanism working for `ValueColumnMetadata`.
 * Introduce new concept `Layer` and removed `NodeType`. More details refer to [v9-version-upgrade](https://skywalking.apache.org/docs/main/latest/en/faq/v9-version-upgrade/).
+* `AnalyzerModuleConfig` code improvement.

Review comment:
       This is not a good changelog, no one can't understand what is a code improvement.




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] dkkb commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
dkkb commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780874894



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java
##########
@@ -50,7 +51,7 @@
      * Read component-libraries.yml for more details.
      */
     @Getter
-    private String noUpstreamRealAddressAgents = Const.EMPTY_STRING;
+    private final String noUpstreamRealAddressAgents = Const.EMPTY_STRING;

Review comment:
       https://github.com/apache/skywalking/blob/1c0fc982b2dc61ca7e452142df7f9846e867d71d/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java#L52-L53
   
   🤔 It seems that we don't modify this filed, and IDE warns us about it. Now I'm not sure. 😂




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780878967



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java
##########
@@ -111,15 +112,15 @@
     @Getter
     private String segmentStatusAnalysisStrategy = FROM_SPAN_STATUS.name();
 
-    private List<Integer> virtualPeers;
+    private Set<Integer> virtualPeers;

Review comment:
       This list in 99% of cases is empty. That is why I am asking. HashSet is not always better than List, especially when we face a small and mostly empty list.
   That is why I am asking, we don't encourage you to change codes by following general idea w/o real use cases.
   SkyWalking is a very complex project, some codes are tricky, even hijacking due to some reason of history, some are real bugs not found before. 
   I want to fully understand the background of changing this.




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] dkkb commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
dkkb commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780874045



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java
##########
@@ -111,15 +112,15 @@
     @Getter
     private String segmentStatusAnalysisStrategy = FROM_SPAN_STATUS.name();
 
-    private List<Integer> virtualPeers;
+    private Set<Integer> virtualPeers;

Review comment:
       [[        analysisListeners.forEach(listener -> {](https://github.com/apache/skywalking/blob/f3b567160ce61675cb692c3417101162d67093de/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/TraceAnalyzer.java#L79)](https://github.com/apache/skywalking/blob/f3b567160ce61675cb692c3417101162d67093de/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/TraceAnalyzer.java#L78-L84)
   
   I think it is worthwhile to modify this field to 'Set' in the preceding code because it can be used in a 'foreach' loop. And all we want to do is make sure `componentId` is included in this `Set`, so `Set` would be ideal.




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780870775



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java
##########
@@ -50,7 +51,7 @@
      * Read component-libraries.yml for more details.
      */
     @Getter
-    private String noUpstreamRealAddressAgents = Const.EMPTY_STRING;
+    private final String noUpstreamRealAddressAgents = Const.EMPTY_STRING;

Review comment:
       This value is set by config and system env, so, can't be final.




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] dkkb commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
dkkb commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780872936



##########
File path: CHANGES.md
##########
@@ -23,6 +23,7 @@ Release Notes.
 * Upgrade H2 version to 2.0.202 to fix CVE-2021-23463.
 * Extend column name override mechanism working for `ValueColumnMetadata`.
 * Introduce new concept `Layer` and removed `NodeType`. More details refer to [v9-version-upgrade](https://skywalking.apache.org/docs/main/latest/en/faq/v9-version-upgrade/).
+* `AnalyzerModuleConfig` code improvement.

Review comment:
       Got it.




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780878528



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java
##########
@@ -50,7 +51,7 @@
      * Read component-libraries.yml for more details.
      */
     @Getter
-    private String noUpstreamRealAddressAgents = Const.EMPTY_STRING;
+    private final String noUpstreamRealAddressAgents = Const.EMPTY_STRING;

Review comment:
       It is not changed directly through codes, it is changed by reflect API of OAP core.
   
   I am checking why you want to change this.




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on a change in pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398#discussion_r780870974



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/AnalyzerModuleConfig.java
##########
@@ -111,15 +112,15 @@
     @Getter
     private String segmentStatusAnalysisStrategy = FROM_SPAN_STATUS.name();
 
-    private List<Integer> virtualPeers;
+    private Set<Integer> virtualPeers;

Review comment:
       This list is very short and nearly never used, as we usually have all agents for all proxies unless it is a private implemented proxy. Why do you think we need to improve this?




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed pull request #8398: `AnalyzerModuleConfig` code improvement.

Posted by GitBox <gi...@apache.org>.
wu-sheng closed pull request #8398:
URL: https://github.com/apache/skywalking/pull/8398


   


-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org