You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/06 13:41:54 UTC

[GitHub] [shardingsphere] jiangML opened a new pull request, #18907: Fixed the null value error of contextManager in ProxyContext when col…

jiangML opened a new pull request, #18907:
URL: https://github.com/apache/shardingsphere/pull/18907

   …lecting monitoring data.
   
   Fixes https://github.com/apache/shardingsphere/issues/18906
   
   Changes proposed in this pull request:
   - Fixed the null value error of contextManager in ProxyContext when collecting monitoring data.
   


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

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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #18907: Fixed the error of null value in contextManager when collecting metric data

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18907:
URL: https://github.com/apache/shardingsphere/pull/18907#issuecomment-1176288727

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18907?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#18907](https://codecov.io/gh/apache/shardingsphere/pull/18907?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4192334) into [master](https://codecov.io/gh/apache/shardingsphere/commit/847d29779238e627ef3be5ce45fdbfa4a2f83e8a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (847d297) will **not change** coverage.
   > The diff coverage is `33.33%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #18907   +/-   ##
   =========================================
     Coverage     59.28%   59.28%           
     Complexity     2292     2292           
   =========================================
     Files          3779     3779           
     Lines         54486    54486           
     Branches       9219     9219           
   =========================================
     Hits          32302    32302           
     Misses        19465    19465           
     Partials       2719     2719           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18907?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...cs/prometheus/collector/MetaDataInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/18907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvTWV0YURhdGFJbmZvQ29sbGVjdG9yLmphdmE=) | `41.17% <0.00%> (ø)` | |
   | [...trics/prometheus/collector/ProxyInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/18907/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvUHJveHlJbmZvQ29sbGVjdG9yLmphdmE=) | `75.00% <50.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18907?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18907?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [847d297...4192334](https://codecov.io/gh/apache/shardingsphere/pull/18907?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

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


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #18907: Fixed the error of null value in contextManager when collecting metric data

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #18907:
URL: https://github.com/apache/shardingsphere/pull/18907#discussion_r915066768


##########
shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/collector/ProxyInfoCollector.java:
##########
@@ -56,10 +56,10 @@ public List<MetricFamilySamples> collect() {
             return Collections.emptyList();
         }
         Optional<GaugeMetricFamily> proxyInfo = FACTORY.createGaugeMetricFamily(MetricIds.PROXY_INFO);
-        Optional<StateContext> stateContext = ProxyContext.getInstance().getStateContext();
-        if (!proxyInfo.isPresent() || !stateContext.isPresent()) {
+        if (null == ProxyContext.getInstance().getContextManager() || !proxyInfo.isPresent()) {

Review Comment:
   Why was the judgment of `!stateContext.isPresent()` removed?



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

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


[GitHub] [shardingsphere] RaigorJiang merged pull request #18907: Fixed the error of null value in contextManager when collecting metric data

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #18907:
URL: https://github.com/apache/shardingsphere/pull/18907


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

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


[GitHub] [shardingsphere] jiangML commented on a diff in pull request #18907: Fixed the error of null value in contextManager when collecting metric data

Posted by GitBox <gi...@apache.org>.
jiangML commented on code in PR #18907:
URL: https://github.com/apache/shardingsphere/pull/18907#discussion_r915386512


##########
shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/main/java/org/apache/shardingsphere/agent/metrics/prometheus/collector/ProxyInfoCollector.java:
##########
@@ -56,10 +56,10 @@ public List<MetricFamilySamples> collect() {
             return Collections.emptyList();
         }
         Optional<GaugeMetricFamily> proxyInfo = FACTORY.createGaugeMetricFamily(MetricIds.PROXY_INFO);
-        Optional<StateContext> stateContext = ProxyContext.getInstance().getStateContext();
-        if (!proxyInfo.isPresent() || !stateContext.isPresent()) {
+        if (null == ProxyContext.getInstance().getContextManager() || !proxyInfo.isPresent()) {

Review Comment:
   I thought that when the ContextManager is not empty, the stateContext will definitely not be empty.
   According to ProxyContext to obtain the internal logic of stateContext, judgment should be added.



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

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