You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Webster-Yang (via GitHub)" <gi...@apache.org> on 2023/02/17 01:38:53 UTC

[GitHub] [dubbo] Webster-Yang opened a new pull request, #11591: add core threadpool metric

Webster-Yang opened a new pull request, #11591:
URL: https://github.com/apache/dubbo/pull/11591

   ## What is the purpose of the change
   
   
   
   ## Brief changelog
   
   
   ## Verifying this change
   
   
   <!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
   
   ## Checklist
   - [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
   - [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
   - [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
   - [ ] GitHub Actions works fine on your own branch.
   - [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
   


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng commented on a diff in pull request #11591: add core threadpool metric

Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on code in PR #11591:
URL: https://github.com/apache/dubbo/pull/11591#discussion_r1111038208


##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/sample/ThreadPoolMetricsSampler.java:
##########
@@ -64,6 +69,20 @@ private void collect() {
             }
         }catch(Exception ex){}
 
+        if (this.dataStore == null) {
+            this.dataStore = collector.getApplicationModel().getExtensionLoader(DataStore.class).getDefaultExtension();

Review Comment:
   please add NullPointException check
   
   9Z [ERROR] org.apache.dubbo.metrics.filter.MetricsFilterTest.testMissingGroupAndVersion  Time elapsed: 0.041 s  <<< ERROR!
   2023-02-18T01:17:26.2131813Z java.lang.NullPointerException: Cannot invoke "org.apache.dubbo.rpc.model.ApplicationModel.getExtensionLoader(java.lang.Class)" because the return value of "org.apache.dubbo.metrics.collector.DefaultMetricsCollector.getApplicationModel()" is null
   2023-02-18T01:17:26.2132911Z 	at org.apache.dubbo.metrics.collector.sample.ThreadPoolMetricsSampler.collect(ThreadPoolMetricsSampler.java:73)
   2023-02-18T01:17:26.2133674Z 	at org.apache.dubbo.metrics.collector.sample.ThreadPoolMetricsSampler.sample(ThreadPoolMetricsSampler.java:53)
   2023-02-18T01:17:26.2134391Z 	at org.apache.dubbo.metrics.collector.DefaultMetricsCollector.collect(DefaultMetricsCollector.java:97)
   2023-02-18T01:17:26.2135048Z 	at org.apache.dubbo.metrics.filter.MetricsFilterTest.getMetricsMap(MetricsFilterTest.java:327)
   2023-02-18T01:17:26.2135741Z 	at org.apache.dubbo.metrics.filter.MetricsFilterTest.testMissingGroupAndVersion(MetricsFilterTest.java:284)
   2023-02-18T01:17:26.2136378Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   2023-02-18T01:17:26.2136970Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)



-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng commented on pull request #11591: add core threadpool metric

Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on PR #11591:
URL: https://github.com/apache/dubbo/pull/11591#issuecomment-1447955189

   please closed unused pr


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng commented on a diff in pull request #11591: add core threadpool metric

Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on code in PR #11591:
URL: https://github.com/apache/dubbo/pull/11591#discussion_r1109296934


##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/sample/ThreadPoolMetricsSampler.java:
##########
@@ -16,28 +16,27 @@
  */
 package org.apache.dubbo.metrics.collector.sample;
 
+import org.apache.dubbo.common.store.DataStore;
 import org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository;
 import org.apache.dubbo.metrics.collector.DefaultMetricsCollector;
 import org.apache.dubbo.metrics.model.MetricsKey;
 import org.apache.dubbo.metrics.model.ThreadPoolMetric;
 import org.apache.dubbo.metrics.model.sample.GaugeMetricSample;
 import org.apache.dubbo.metrics.model.sample.MetricSample;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;

Review Comment:
   don't use * import



-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] songxiaosheng commented on pull request #11591: add core threadpool metric

Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on PR #11591:
URL: https://github.com/apache/dubbo/pull/11591#issuecomment-1436355089

   fix #11581


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wxbty commented on a diff in pull request #11591: add core threadpool metric

Posted by "wxbty (via GitHub)" <gi...@apache.org>.
wxbty commented on code in PR #11591:
URL: https://github.com/apache/dubbo/pull/11591#discussion_r1109885773


##########
dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/sample/ThreadPoolMetricsSampler.java:
##########
@@ -64,6 +63,20 @@ private void collect() {
             }
         }catch(Exception ex){}
 
+        if (this.dataStore == null) {
+            this.dataStore = collector.getApplicationModel().getExtensionLoader(DataStore.class).getDefaultExtension();
+        }

Review Comment:
   Should these initialization operations be placed in the constructor



-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ closed pull request #11591: add core threadpool metric

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed pull request #11591: add core threadpool metric
URL: https://github.com/apache/dubbo/pull/11591


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org