use of com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo in project honest-profiler by jvm-profiling-tools.
the class ReferenceUtil method switchReference.
/**
* Set the reference of all {@link Node}s contained in the provided {@link Tree} according to the specified
* {@link ReferenceMode}. The reference of a {@link Node} is used for calculating the percentage values.
* <p>
* Please consult the {@link ReferenceMode} documentation for more information about the meaning of the reference
* modes.
* <p>
* WARNING : the {@link ReferenceMode#THREAD} mode can only be used for {@link Tree}s or {@link TreeDiff}s where the
* top-level children represent thread-level aggregations. Similarly, the {@link ReferenceMode#PARENT} mode can only
* be used in {@link Tree}s or {@link TreeDiff}s.
* <p>
* @param tree the {@link Tree} whose references are to be changed
* @param mode the strategy for setting the references
*/
public static void switchReference(Tree tree, ReferenceMode mode) {
switch(mode) {
case GLOBAL:
NumericInfo global = tree.getSource().getGlobalData();
tree.flatten().forEach(node -> node.setReference(global));
return;
case THREAD:
tree.getData().forEach(rootNode -> {
// The root nodes are presumed to be thread-level aggregations. If not, the results are unspecified.
NumericInfo reference = rootNode.getData();
rootNode.getChildren().forEach(child -> child.flatten().forEach(node -> node.setReference(reference)));
});
return;
case PARENT:
tree.getData().forEach(node -> setReferenceToParent(null, node));
return;
}
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo in project honest-profiler by jvm-profiling-tools.
the class LeanProfileGenerator method assertTotalTimeEquals.
public void assertTotalTimeEquals(long totalTime, long threadId, StackFrame... stack) {
NumericInfo info = getNode(threadId, stack).getData();
assertEquals("Wrong Total Time", BigInteger.valueOf(totalTime), info.getTotalTime());
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo in project honest-profiler by jvm-profiling-tools.
the class LeanProfileGenerator method assertSelfCountEquals.
public void assertSelfCountEquals(int selfCount, long threadId, StackFrame... stack) {
NumericInfo info = getNode(threadId, stack).getData();
assertEquals("Wrong Self Count", selfCount, info.getSelfCnt());
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo in project honest-profiler by jvm-profiling-tools.
the class LeanProfileGenerator method assertCountsEqual.
public void assertCountsEqual(int selfCount, int totalCount, long threadId, StackFrame... stack) {
NumericInfo info = getNode(threadId, stack).getData();
assertEquals("Wrong Self Count", selfCount, info.getSelfCnt());
assertEquals("Wrong Total Count", totalCount, info.getTotalCnt());
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo in project honest-profiler by jvm-profiling-tools.
the class LeanProfileGenerator method assertTotalCountEquals.
public void assertTotalCountEquals(int totalCount, long threadId, StackFrame... stack) {
NumericInfo info = getNode(threadId, stack).getData();
assertEquals("Wrong Total Count", totalCount, info.getTotalCnt());
}
Aggregations