You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/05/04 12:38:12 UTC

[GitHub] [cloudstack] joseflauzino opened a new pull request, #6357: Add logs to the listLoadBalancerRuleInstances API

joseflauzino opened a new pull request, #6357:
URL: https://github.com/apache/cloudstack/pull/6357

   ### Description
   
   Currently, the listLoadBalancerRuleInstances API has no logs, which makes troubleshooting harder.
   This PR aims to add several logs with context on the processing performed by this API. This will allow cloud operators to better analyze possible errors or inconsistencies that may occur when using the API.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   ### How Has This Been Tested?
   
   I performed different calls to the listLoadBalancerRuleInstances API and could notice that the processes were logged correctly.


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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1232954360

   @DaanHoogland 
   Most of the log messages added/improved in this PR are really useful for debugging purposes. There are only two exceptions, which are presented as warning and error. Considering the characteristics of all the messages involved, I think the log levels are appropriate.


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

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


Re: [PR] Add logs to the listLoadBalancerRuleInstances API [cloudstack]

Posted by "shwstppr (via GitHub)" <gi...@apache.org>.
shwstppr commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1744573146

   @joseflauzino can you please address the review comments?


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215127576

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3988


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

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


[GitHub] [cloudstack] github-actions[bot] commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1208060133

   This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1292123826

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 4558


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

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


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r873451924


##########
api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java:
##########
@@ -97,7 +97,10 @@ public String getCommandName() {
     public void execute() {
         Pair<List<? extends UserVm>, List<String>> vmServiceMap =  _lbService.listLoadBalancerInstances(this);
         List<? extends UserVm> result = vmServiceMap.first();
+        s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));

Review Comment:
   ```suggestion
           if (result != null && s_logger.isDebugEnabled()) {
               s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));
           }
   ```



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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1124975788

   @acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


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

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


[GitHub] [cloudstack] GutoVeronezi commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1697909831

   @joseflauzino, do you plan on continuing this PR? Is it still necessary?


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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1126236458

   @blueorangutan package


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

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


[GitHub] [cloudstack] DaanHoogland commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215223556

   @joseflauzino , I don´t think your argument holds, in the long run we should avoid debug statements in production environments. If you think your logging is valid in production you should give it a higher level.
   @blueorangutan test


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

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


Re: [PR] Add logs to the listLoadBalancerRuleInstances API [cloudstack]

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi closed pull request #6357: Add logs to the listLoadBalancerRuleInstances API
URL: https://github.com/apache/cloudstack/pull/6357


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

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


Re: [PR] Add logs to the listLoadBalancerRuleInstances API [cloudstack]

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1808495022

   @DaanHoogland @shwstppr @joseflauzino I will close this PR as its changes is being addressed along with some other refactoring in #8094 


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

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


[GitHub] [cloudstack] GutoVeronezi commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r870653194


##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -2231,11 +2235,21 @@ public Pair<List<? extends UserVm>, List<String>> listLoadBalancerInstances(List
                 continue;
             }
 
+            String userVmAsString = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(userVm, "uuid", "name");

Review Comment:
   As `UserVmVO` extends `VMInstanceVO` and `VMInstanceVO` has an implementation of `toString`, we could use it instead of the `ReflectionToStringBuilderUtils.reflectOnlySelectedFields`.



##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -2189,13 +2190,16 @@ public Pair<List<? extends UserVm>, List<String>> listLoadBalancerInstances(List
         Boolean applied = cmd.isApplied();
 
         if (applied == null) {
+            s_logger.debug(String.format("The [%s] parameter was not passed. Using the default value [%s].", ApiConstants.APPLIED, Boolean.TRUE));
             applied = Boolean.TRUE;
         }
 
         LoadBalancerVO loadBalancer = _lbDao.findById(loadBalancerId);
         if (loadBalancer == null) {
+            s_logger.warn(String.format("Unable to find the load balancer with ID [%s].", cmd.getId()));
             return null;
         }
+        String loadBalancerAsString = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(loadBalancer, "uuid", "name");

Review Comment:
   We could implement `toString` of `LoadBalancerVO`. This way we can call `toString` instead of repeating the same code wherever it is used.



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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by "joseflauzino (via GitHub)" <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1723681445

   Hi @GutoVeronezi! Sorry for the delay.
   These logs are very useful when troubleshooting problems related to the mentioned API.
   As we discussed in another channel, it might be better to implement this kind of log using log4j2 to avoid adding conditional structures.
   You also mentioned that you could add these logs to another PR that is upgrading log4j to log4j2 (or something like that).
   
   Please feel absolutely free to do so. I'd really appreciate 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: commits-unsubscribe@cloudstack.apache.org

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


[GitHub] [cloudstack] acs-robot commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
acs-robot commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1124937974

   Found UI changes, kicking a new UI QA build
   @blueorangutan ui


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

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


[GitHub] [cloudstack] acs-robot commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
acs-robot commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1124973823

   Found UI changes, kicking a new UI QA build
   @blueorangutan ui


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

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


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1125029737

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=6357)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_duplicated_lines_density&view=list)
   
   


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

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


[GitHub] [cloudstack] GutoVeronezi commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r949614247


##########
engine/schema/src/main/java/com/cloud/network/dao/LoadBalancerVO.java:
##########
@@ -136,4 +136,9 @@ public Scheme getScheme() {
     public String getCidrList() {
         return cidrList;
     }
+
+    @Override
+    public String toString() {
+        return String.format("Load Balancer {uuid: \"%s\", name: \"%s\"}", getUuid(), name);

Review Comment:
   We can use `ReflectionToStringBuilderUtils` here.



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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215300395

   <b>Trillian Build Failed (tid-4695)<b/>


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

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


[GitHub] [cloudstack] DaanHoogland commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1229907146

   > @joseflauzino , I don´t think your argument holds, in the long run we should avoid debug statements in production environments. If you think your logging is valid in production you should give it a higher level.
   
   @joseflauzino please review your loging statements and make sure anything you want in present in production is at least at INFO level. You are right that this is not perfectly implemented this way, but that does not mean we shouldn´t improve on 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: commits-unsubscribe@cloudstack.apache.org

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1126269665

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3405


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1292029042

   @joseflauzino a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


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

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


[GitHub] [cloudstack] joseflauzino commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r1005671881


##########
engine/schema/src/main/java/com/cloud/network/dao/LoadBalancerVO.java:
##########
@@ -136,4 +136,9 @@ public Scheme getScheme() {
     public String getCidrList() {
         return cidrList;
     }
+
+    @Override
+    public String toString() {
+        return String.format("Load Balancer {uuid: \"%s\", name: \"%s\"}", getUuid(), name);

Review Comment:
   @GutoVeronezi 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@cloudstack.apache.org

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1117597198

   @joseflauzino a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


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

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


Re: [PR] Add logs to the listLoadBalancerRuleInstances API [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1787271496

   @joseflauzino are you going to address any of my comments or apply any of my suggestions?


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1124943935

   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6357 (SL-JID-1566)


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1124990614

   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6357 (SL-JID-1567)


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

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


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r873451924


##########
api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java:
##########
@@ -97,7 +97,10 @@ public String getCommandName() {
     public void execute() {
         Pair<List<? extends UserVm>, List<String>> vmServiceMap =  _lbService.listLoadBalancerInstances(this);
         List<? extends UserVm> result = vmServiceMap.first();
+        s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));

Review Comment:
   ```suggestion
           if (s_logger.isDebugEnabled()) {
               s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));
           }
   ```



##########
api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java:
##########
@@ -97,7 +97,10 @@ public String getCommandName() {
     public void execute() {
         Pair<List<? extends UserVm>, List<String>> vmServiceMap =  _lbService.listLoadBalancerInstances(this);
         List<? extends UserVm> result = vmServiceMap.first();
+        s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));
+
         List<String> serviceStates  = vmServiceMap.second();
+        s_logger.debug(String.format("A total of [%s] service states were obtained when listing the load balancer instances: [%s].", serviceStates.size(), serviceStates.toString()));

Review Comment:
   ```suggestion
           if (s_logger.isDebugEnabled()) {
               s_logger.debug(String.format("A total of [%s] service states were obtained when listing the load balancer instances: [%s].", serviceStates.size(), serviceStates.toString()));
           }
   ```



##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -2231,11 +2234,21 @@ public Pair<List<? extends UserVm>, List<String>> listLoadBalancerInstances(List
                 continue;
             }
 
+            String userVmAsString = userVm.toString();
+
             boolean isApplied = appliedInstanceIdList.contains(userVm.getId());
-            if ((isApplied && applied) || (!isApplied && !applied)) {
-                loadBalancerInstances.add(userVm);
-                serviceStates.add(vmServiceState.get(userVm.getId()));
+            String isAppliedMsg = isApplied ? "is applied" : "is not applied";
+            s_logger.debug(String.format("The user VM [%s] %s to a rule of the load balancer [%s].", userVmAsString, isAppliedMsg, loadBalancerAsString));

Review Comment:
   ```suggestion
               if (s_logger.isDebugEnabled()) {
                   s_logger.debug(String.format("The user VM [%s] %s to a rule of the load balancer [%s].", userVmAsString, isAppliedMsg, loadBalancerAsString));
               }
   ```



##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -2189,13 +2189,16 @@ public Pair<List<? extends UserVm>, List<String>> listLoadBalancerInstances(List
         Boolean applied = cmd.isApplied();
 
         if (applied == null) {
+            s_logger.debug(String.format("The [%s] parameter was not passed. Using the default value [%s].", ApiConstants.APPLIED, Boolean.TRUE));

Review Comment:
   ```suggestion
               if (s_logger.isDebugEnabled()) {
                   s_logger.debug(String.format("The [%s] parameter was not passed. Using the default value [%s].", ApiConstants.APPLIED, Boolean.TRUE));
               }
   ```



##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -2231,11 +2234,21 @@ public Pair<List<? extends UserVm>, List<String>> listLoadBalancerInstances(List
                 continue;
             }
 
+            String userVmAsString = userVm.toString();
+
             boolean isApplied = appliedInstanceIdList.contains(userVm.getId());
-            if ((isApplied && applied) || (!isApplied && !applied)) {
-                loadBalancerInstances.add(userVm);
-                serviceStates.add(vmServiceState.get(userVm.getId()));
+            String isAppliedMsg = isApplied ? "is applied" : "is not applied";
+            s_logger.debug(String.format("The user VM [%s] %s to a rule of the load balancer [%s].", userVmAsString, isAppliedMsg, loadBalancerAsString));
+
+            if (isApplied != applied) {
+                s_logger.debug(String.format("Skipping add service state from the user VM [%s] to the service state list. This happens because the VM %s to the load "
+                        + "balancer rule and the [%s] parameter was passed as [%s].", userVmAsString, isAppliedMsg, ApiConstants.APPLIED, applied));
+                continue;
             }
+            loadBalancerInstances.add(userVm);
+            String serviceState = vmServiceState.get(userVm.getId());
+            s_logger.debug(String.format("Add the service state [%s] from the user VM [%s] to the service state list.", serviceState, userVmAsString));

Review Comment:
   ```suggestion
               if (s_logger.isDebugEnabled()) {
                   s_logger.debug(String.format("Add the service state [%s] from the user VM [%s] to the service state list.", serviceState, userVmAsString));
               }
   ```



##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -2231,11 +2234,21 @@ public Pair<List<? extends UserVm>, List<String>> listLoadBalancerInstances(List
                 continue;
             }
 
+            String userVmAsString = userVm.toString();
+
             boolean isApplied = appliedInstanceIdList.contains(userVm.getId());
-            if ((isApplied && applied) || (!isApplied && !applied)) {
-                loadBalancerInstances.add(userVm);
-                serviceStates.add(vmServiceState.get(userVm.getId()));
+            String isAppliedMsg = isApplied ? "is applied" : "is not applied";
+            s_logger.debug(String.format("The user VM [%s] %s to a rule of the load balancer [%s].", userVmAsString, isAppliedMsg, loadBalancerAsString));
+
+            if (isApplied != applied) {
+                s_logger.debug(String.format("Skipping add service state from the user VM [%s] to the service state list. This happens because the VM %s to the load "
+                        + "balancer rule and the [%s] parameter was passed as [%s].", userVmAsString, isAppliedMsg, ApiConstants.APPLIED, applied));

Review Comment:
   ```suggestion
                   if (s_logger.isDebugEnabled()) {
                       s_logger.debug(String.format("Skipping add service state from the user VM [%s] to the service state list. This happens because the VM %s to the load "
                           + "balancer rule and the [%s] parameter was passed as [%s].", userVmAsString, isAppliedMsg, ApiConstants.APPLIED, applied));
                  }
   ```



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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1292028378

   @blueorangutan package


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

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


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1292155040

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=6357)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_duplicated_lines_density&view=list)
   
   


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

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


Re: [PR] Add logs to the listLoadBalancerRuleInstances API [cloudstack]

Posted by "GutoVeronezi (via GitHub)" <gi...@apache.org>.
GutoVeronezi commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1788010674

   @DaanHoogland @shwstppr I talked with @joseflauzino offline and I'll handle this PR later; not necessary for 4.19.


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

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


[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r873451924


##########
api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java:
##########
@@ -97,7 +97,10 @@ public String getCommandName() {
     public void execute() {
         Pair<List<? extends UserVm>, List<String>> vmServiceMap =  _lbService.listLoadBalancerInstances(this);
         List<? extends UserVm> result = vmServiceMap.first();
+        s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));

Review Comment:
   ```suggestion
           if (result != null && s_logger.isDebugEnabled()) {
               s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));
           }
   ```



##########
api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java:
##########
@@ -97,7 +97,10 @@ public String getCommandName() {
     public void execute() {
         Pair<List<? extends UserVm>, List<String>> vmServiceMap =  _lbService.listLoadBalancerInstances(this);
         List<? extends UserVm> result = vmServiceMap.first();
+        s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));

Review Comment:
   ```suggestion
           if (result != null && s_logger.isDebugEnabled()) {
               s_logger.debug(String.format("A total of [%s] user VMs were obtained when listing the load balancer instances: [%s].", result.size(), result.toString()));
           }
   ```



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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1126237113

   @joseflauzino a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215225310

   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215072881

   Hi @DaanHoogland, sorry for the delay in responding.
   
   Regarding your suggested code changes:
   In these particular code snippets, I have a preference for not using the `isDebugEnabled()` check.
   
   The main reason is that this check can provide a significant performance improvement only when the message construction is very costly, which I don't think is the case. In these snippets, the messages are built by the concatenation of strings (no need for expensive calculations or processing).
   
   Also, if the logger is enabled at the debug level, it incurs the cost of evaluating whether the logger is enabled or not twice: once in `isDebugEnabled()` and once in `debug()`. Since it is very common for ACS users to leave the logger enabled for the debug level  (because of the useful messages for troubleshoting), I don't think it is worth doing this check (especially with simple strings).


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215066490

   @joseflauzino a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


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

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


[GitHub] [cloudstack] codecov[bot] commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215123942

   # [Codecov](https://codecov.io/gh/apache/cloudstack/pull/6357?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 [#6357](https://codecov.io/gh/apache/cloudstack/pull/6357?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fd293ce) into [main](https://codecov.io/gh/apache/cloudstack/commit/152a2748457344c974b3541a0e7a833c2962f955?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (152a274) will **increase** coverage by `0.00%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##               main    #6357   +/-   ##
   =========================================
     Coverage      5.87%    5.87%           
   - Complexity     3933     3934    +1     
   =========================================
     Files          2454     2454           
     Lines        242633   242644   +11     
     Branches      37970    37971    +1     
   =========================================
   + Hits          14246    14248    +2     
   - Misses       226811   226819    +8     
   - Partials       1576     1577    +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/cloudstack/pull/6357?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ain/java/com/cloud/network/dao/LoadBalancerVO.java](https://codecov.io/gh/apache/cloudstack/pull/6357/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-ZW5naW5lL3NjaGVtYS9zcmMvbWFpbi9qYXZhL2NvbS9jbG91ZC9uZXR3b3JrL2Rhby9Mb2FkQmFsYW5jZXJWTy5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...loud/network/lb/LoadBalancingRulesManagerImpl.java](https://codecov.io/gh/apache/cloudstack/pull/6357/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-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL25ldHdvcmsvbGIvTG9hZEJhbGFuY2luZ1J1bGVzTWFuYWdlckltcGwuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...apache/cloudstack/alert/snmp/SnmpTrapAppender.java](https://codecov.io/gh/apache/cloudstack/pull/6357/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-cGx1Z2lucy9hbGVydC1oYW5kbGVycy9zbm1wLWFsZXJ0cy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hbGVydC9zbm1wL1NubXBUcmFwQXBwZW5kZXIuamF2YQ==) | `61.05% <0.00%> (+2.10%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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: commits-unsubscribe@cloudstack.apache.org

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1216138334

   <b>Trillian test result (tid-4697)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 42409 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6357-t4697-kvm-centos7.zip
   Smoke tests completed. 100 look OK, 1 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 599.17 | test_kubernetes_clusters.py
   


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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1215065158

   @blueorangutan package


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1117631004

   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3350


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

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


[GitHub] [cloudstack] joseflauzino commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1117596920

   @blueorangutan package


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

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


[GitHub] [cloudstack] sonarcloud[bot] commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1117326174

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=6357)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=6357&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL) [![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png 'B')](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=6357&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=6357&metric=new_duplicated_lines_density&view=list)
   
   


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

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


[GitHub] [cloudstack] blueorangutan commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1124938601

   @acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


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

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


[GitHub] [cloudstack] GutoVeronezi commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r967095313


##########
engine/schema/src/main/java/com/cloud/network/dao/LoadBalancerVO.java:
##########
@@ -136,4 +136,9 @@ public Scheme getScheme() {
     public String getCidrList() {
         return cidrList;
     }
+
+    @Override
+    public String toString() {
+        return String.format("Load Balancer {uuid: \"%s\", name: \"%s\"}", getUuid(), name);

Review Comment:
   `ReflectionToStringBuilderUtils` uses `ReflectionUtils.getAllFields`, which will also retrieve fields of the super types too; therefore it will work properly.



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

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


[GitHub] [cloudstack] joseflauzino commented on a diff in pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
joseflauzino commented on code in PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#discussion_r956051653


##########
engine/schema/src/main/java/com/cloud/network/dao/LoadBalancerVO.java:
##########
@@ -136,4 +136,9 @@ public Scheme getScheme() {
     public String getCidrList() {
         return cidrList;
     }
+
+    @Override
+    public String toString() {
+        return String.format("Load Balancer {uuid: \"%s\", name: \"%s\"}", getUuid(), name);

Review Comment:
   @GutoVeronezi 
   I think `ReflectionToStringBuilderUtils` will not work properly here, since `LoadBalancerVO` doesn't have the `uuid` attribute (it's inherited from `FirewallRuleVO`). So I've used `String.format()` getting the `uuid` from the getter method.



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

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


[GitHub] [cloudstack] DaanHoogland commented on pull request #6357: Add logs to the listLoadBalancerRuleInstances API

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on PR #6357:
URL: https://github.com/apache/cloudstack/pull/6357#issuecomment-1278655627

   ok @joseflauzino but where ever there is a string operation done in the parameter passing I would still like the `if (log.isDebugEnabled())` guard around it. Other wise fine.


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

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