From 8c4df624acdf10565401f16d134465930d31d48d Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 10 Jun 2018 00:24:43 +0100 Subject: don't include line numbers lul --- .../me/lucko/spark/profiler/node/AbstractNode.java | 12 ++++++------ .../me/lucko/spark/profiler/node/StackTraceNode.java | 19 ++++++------------- 2 files changed, 12 insertions(+), 19 deletions(-) (limited to 'spark-common') diff --git a/spark-common/src/main/java/me/lucko/spark/profiler/node/AbstractNode.java b/spark-common/src/main/java/me/lucko/spark/profiler/node/AbstractNode.java index 04425c6..4a209b1 100644 --- a/spark-common/src/main/java/me/lucko/spark/profiler/node/AbstractNode.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/node/AbstractNode.java @@ -50,10 +50,10 @@ public abstract class AbstractNode { return this.totalTime.longValue(); } - private AbstractNode resolveChild(String className, String methodName, int lineNumber) { + private AbstractNode resolveChild(String className, String methodName) { return this.children.computeIfAbsent( - StackTraceNode.generateKey(className, methodName, lineNumber), - name -> new StackTraceNode(className, methodName, lineNumber) + StackTraceNode.generateKey(className, methodName), + name -> new StackTraceNode(className, methodName) ); } @@ -73,7 +73,7 @@ public abstract class AbstractNode { } StackTraceElement bottom = elements[elements.length - (skip + 1)]; - resolveChild(bottom.getClassName(), bottom.getMethodName(), Math.max(0, bottom.getLineNumber())).log(elements, skip + 1, time); + resolveChild(bottom.getClassName(), bottom.getMethodName()).log(elements, skip + 1, time); } private Collection getChildren() { @@ -93,12 +93,12 @@ public abstract class AbstractNode { appendMetadata(writer); // include the total time recorded for this node - writer.name("totalTime").value(getTotalTime()); + writer.name("t").value(getTotalTime()); // append child nodes, if any are present Collection childNodes = getChildren(); if (!childNodes.isEmpty()) { - writer.name("children").beginArray(); + writer.name("c").beginArray(); for (AbstractNode child : childNodes) { child.serializeTo(writer); } diff --git a/spark-common/src/main/java/me/lucko/spark/profiler/node/StackTraceNode.java b/spark-common/src/main/java/me/lucko/spark/profiler/node/StackTraceNode.java index 706d2e0..7dbeb87 100644 --- a/spark-common/src/main/java/me/lucko/spark/profiler/node/StackTraceNode.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/node/StackTraceNode.java @@ -32,37 +32,30 @@ public final class StackTraceNode extends AbstractNode implements Comparable