You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/03/04 14:08:31 UTC
[GitHub] [sling-org-apache-sling-scripting-core] raducotescu opened a new pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
raducotescu opened a new pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14
* log conditionally: request progress tracker or normal component log
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] sonarcloud[bot] edited a comment on pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] edited a comment on pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#issuecomment-1059202838
SonarCloud Quality Gate failed. 
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_coverage&view=list) [28.6% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] raducotescu commented on pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
raducotescu commented on pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#issuecomment-1062798590
@karlpauls, @joerghoh, are you ok with this change?
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] sonarcloud[bot] commented on pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#issuecomment-1059202838
SonarCloud Quality Gate failed. 
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_coverage&view=list) [28.6% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] raducotescu merged pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
raducotescu merged pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] joerghoh commented on a change in pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
joerghoh commented on a change in pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#discussion_r822560148
##########
File path: src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
##########
@@ -742,13 +746,20 @@ Bindings verifySlingBindings(final SlingBindings slingBindings) throws IOExcepti
LOGGER.trace("Invoking addBindings() of {} took {} nanoseconds",
provider.getClass().getName(), stop-start);
if (stop-start > WARN_LIMIT_FOR_BVP_NANOS) {
- LOGGER.info("Adding the bindings of {} took {} microseconds which is above the harcoded limit of {} microseconds;"
- + " if this message appears often it indicates that this BindingsValuesProvider has an impact on general page rendering performance",
- new Object[]{provider.getClass().getName(), (stop-start)/1000, WARN_LIMIT_FOR_BVP_NANOS/1000});
+ // SLING-11182 - make this work with older implementations of the Sling API
+ if (request != null && request.getRequestProgressTracker() != null) {
+ request.getRequestProgressTracker().log(String.format(BINDINGS_THRESHOLD_MESSAGE, provider.getClass().getName(), (stop-start)/1000, WARN_LIMIT_FOR_BVP_NANOS/1000));
Review comment:
in case a progressTracker is available it just writes the message into the RPT, but not anymore into the logs (as before).
Technically that would count as regression, but I was never really confident with this way of reporting.
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] raducotescu commented on a change in pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
raducotescu commented on a change in pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#discussion_r822891215
##########
File path: src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
##########
@@ -742,13 +746,20 @@ Bindings verifySlingBindings(final SlingBindings slingBindings) throws IOExcepti
LOGGER.trace("Invoking addBindings() of {} took {} nanoseconds",
provider.getClass().getName(), stop-start);
if (stop-start > WARN_LIMIT_FOR_BVP_NANOS) {
- LOGGER.info("Adding the bindings of {} took {} microseconds which is above the harcoded limit of {} microseconds;"
- + " if this message appears often it indicates that this BindingsValuesProvider has an impact on general page rendering performance",
- new Object[]{provider.getClass().getName(), (stop-start)/1000, WARN_LIMIT_FOR_BVP_NANOS/1000});
+ // SLING-11182 - make this work with older implementations of the Sling API
+ if (request != null && request.getRequestProgressTracker() != null) {
+ request.getRequestProgressTracker().log(String.format(BINDINGS_THRESHOLD_MESSAGE, provider.getClass().getName(), (stop-start)/1000, WARN_LIMIT_FOR_BVP_NANOS/1000));
Review comment:
I know, but it was a conscious decision - I'd like this logging to be consistent. :D
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] sonarcloud[bot] edited a comment on pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] edited a comment on pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#issuecomment-1059202838
SonarCloud Quality Gate failed. 
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_coverage&view=list) [28.6% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-core&pullRequest=14&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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-scripting-core] joerghoh commented on pull request #14: SLING-11182 - Correct potential errors introduced by BVP logging
Posted by GitBox <gi...@apache.org>.
joerghoh commented on pull request #14:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/14#issuecomment-1062833322
+1 from my side
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org