diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-09-29 12:13:10 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-09-29 12:13:10 +0100 |
commit | 25b78d313233c9cff14953b960b0c0d89b109478 (patch) | |
tree | 858ca906e01e5af03139fa7b61dd189ba6a59de0 /src/core/lombok/eclipse | |
parent | 4788403d749c293af3a9d1b9dd3f83da6dbe0fe6 (diff) | |
download | lombok-25b78d313233c9cff14953b960b0c0d89b109478.tar.gz lombok-25b78d313233c9cff14953b960b0c0d89b109478.tar.bz2 lombok-25b78d313233c9cff14953b960b0c0d89b109478.zip |
histogram tracker now nanoTime based; lombok itself can be histogrammed now with -Dlombok.histogram
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/TransformEclipseAST.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/TransformEclipseAST.java b/src/core/lombok/eclipse/TransformEclipseAST.java index 11caf5c2..e6528178 100644 --- a/src/core/lombok/eclipse/TransformEclipseAST.java +++ b/src/core/lombok/eclipse/TransformEclipseAST.java @@ -26,6 +26,7 @@ import static lombok.eclipse.handlers.EclipseHandlerUtil.*; import java.lang.reflect.Field; import lombok.core.debug.DebugSnapshotStore; +import lombok.core.debug.HistogramTracker; import lombok.patcher.Symbols; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; @@ -57,6 +58,14 @@ public class TransformEclipseAST { private static final HandlerLibrary handlers; public static boolean disableLombok = false; + private static final HistogramTracker lombokTracker; + + static { + String v = System.getProperty("lombok.histogram"); + if (v == null) lombokTracker = null; + else if (v.toLowerCase().equals("sysout")) lombokTracker = new HistogramTracker("lombok.histogram", System.out); + else lombokTracker = new HistogramTracker("lombok.histogram"); + } static { Field f = null; @@ -136,8 +145,10 @@ public class TransformEclipseAST { try { DebugSnapshotStore.INSTANCE.snapshot(ast, "transform entry"); + long histoToken = lombokTracker == null ? 0L : lombokTracker.start(); EclipseAST existing = getAST(ast, false); new TransformEclipseAST(existing).go(); + if (lombokTracker != null) lombokTracker.end(histoToken); DebugSnapshotStore.INSTANCE.snapshot(ast, "transform exit"); } catch (Throwable t) { DebugSnapshotStore.INSTANCE.snapshot(ast, "transform error: %s", t.getClass().getSimpleName()); |