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 2022/10/12 12:45:08 UTC

[sling-org-apache-sling-engine] branch SLING-11618-fix-slingfilter-webconsole created (now e2589b4)

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

joerghoh pushed a change to branch SLING-11618-fix-slingfilter-webconsole
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git


      at e2589b4  SLING-11618 fix units in the slingfilter webconsole printer

This branch includes the following new commits:

     new e2589b4  SLING-11618 fix units in the slingfilter webconsole printer

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-engine] 01/01: SLING-11618 fix units in the slingfilter webconsole printer

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

joerghoh pushed a commit to branch SLING-11618-fix-slingfilter-webconsole
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git

commit e2589b4040c27c04eb77746a6ede6773b72e3550
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Wed Oct 12 14:44:53 2022 +0200

    SLING-11618 fix units in the slingfilter webconsole printer
---
 .../org/apache/sling/engine/impl/console/WebConsoleConfigPrinter.java | 2 +-
 src/main/java/org/apache/sling/engine/impl/filter/FilterHandle.java   | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/engine/impl/console/WebConsoleConfigPrinter.java b/src/main/java/org/apache/sling/engine/impl/console/WebConsoleConfigPrinter.java
index 5bb1d80..e773faf 100644
--- a/src/main/java/org/apache/sling/engine/impl/console/WebConsoleConfigPrinter.java
+++ b/src/main/java/org/apache/sling/engine/impl/console/WebConsoleConfigPrinter.java
@@ -52,7 +52,7 @@ public class WebConsoleConfigPrinter {
      */
     private void printFilterChain(final PrintWriter pw, final FilterHandle[] entries) {
         for(final FilterHandle entry : entries) {
-            pw.printf("%d : %s (id: %d, property: %s); called: %d; time: %dms; time/call: %dµs%n",
+            pw.printf("%d : %s (id: %d, property: %s); called: %d; time: %dµs; time/call: %dµs%n",
                 entry.getOrder(), entry.getFilter().getClass(), entry.getFilterId(), entry.getOrderSource(),
                 entry.getCalls(), entry.getTime(), entry.getTimePerCall());
         }
diff --git a/src/main/java/org/apache/sling/engine/impl/filter/FilterHandle.java b/src/main/java/org/apache/sling/engine/impl/filter/FilterHandle.java
index 3e713a0..aee0d1d 100644
--- a/src/main/java/org/apache/sling/engine/impl/filter/FilterHandle.java
+++ b/src/main/java/org/apache/sling/engine/impl/filter/FilterHandle.java
@@ -85,14 +85,16 @@ public class FilterHandle implements Comparable<FilterHandle> {
         return time.get();
     }
 
+    // timing unit is in microseconds
     public long getTimePerCall() {
-        return (getCalls() > 0) ? (1000L * getTime() / getCalls()) : -1;
+        return (getCalls() > 0) ? (getTime() / getCalls()) : -1;
     }
 
     void track() {
         calls.incrementAndGet();
     }
 
+    // time is tracked in microseconds
     void trackTime(long time) {
         this.time.addAndGet(time);
         if (mbean != null) {