You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2023/07/18 17:20:42 UTC

[sling-org-apache-sling-servlets-post] branch SLING-11971-log-postprocessors created (now 10af3d0)

This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a change to branch SLING-11971-log-postprocessors
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-post.git


      at 10af3d0  SLING-11971 log duration of each postprocessor

This branch includes the following new commits:

     new 10af3d0  SLING-11971 log duration of each postprocessor

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-servlets-post] 01/01: SLING-11971 log duration of each postprocessor

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a commit to branch SLING-11971-log-postprocessors
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-post.git

commit 10af3d015693957dd2005db738ed59f303906389
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Tue Jul 18 19:20:28 2023 +0200

    SLING-11971 log duration of each postprocessor
---
 .../java/org/apache/sling/servlets/post/AbstractPostOperation.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java b/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
index e62e275..5f27ed7 100644
--- a/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
+++ b/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
@@ -16,6 +16,8 @@
  */
 package org.apache.sling.servlets.post;
 
+import java.time.Duration;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -108,7 +110,10 @@ public abstract class AbstractPostOperation implements PostOperation {
             // invoke processors
             if (processors != null) {
                 for (SlingPostProcessor processor : processors) {
+                    Instant start = Instant.now();
                     processor.process(request, changes);
+                    request.getRequestProgressTracker().log("Postprocessor %s took %d ms",processors.getClass().getName(), 
+                            Duration.between(start,Instant.now()).toMillis());
                 }
             }