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 2021/07/07 07:35:59 UTC

[GitHub] [sling-org-apache-sling-scripting-core] bdelacretaz commented on a change in pull request #8: SLING-10584 log an info message if adding bindings takes more than 1 msec

bdelacretaz commented on a change in pull request #8:
URL: https://github.com/apache/sling-org-apache-sling-scripting-core/pull/8#discussion_r665118859



##########
File path: src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
##########
@@ -732,7 +732,14 @@ Bindings verifySlingBindings(final SlingBindings slingBindings) throws IOExcepti
 
             ProtectedBindings protectedBindings = new ProtectedBindings(bindings, protectedKeys);
             for (BindingsValuesProvider provider : bindingsValuesProviders) {
+                long start = System.nanoTime();
                 provider.addBindings(protectedBindings);
+                long stop = System.nanoTime();
+                if (stop-start > (1000*1000)) { // 1 ms

Review comment:
       it would be good to use a named constant for this value, also to avoid duplicating it in the ScriptContextProvider




-- 
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