public class StacktraceTreeModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private IAttribute<IQuantity> |
attribute |
private static FrameSeparator |
DEFAULT_FRAME_SEPARATOR |
private FrameSeparator |
frameSeparator |
private boolean |
invertedStacks |
private IItemCollection |
items |
private Node |
root |
private static IMCFrame |
ROOT_FRAME
A special marker object that indicates a hand-crafted frame at the root of the tree.
|
private static IMCFrame |
UNKNOWN_FRAME
A special marker object that indicates a frame that cannot be determined.
|
Constructor and Description |
---|
StacktraceTreeModel(IItemCollection items)
Builds a StacktraceTreeModel from a given collection of events with defaults: frame separator
METHOD, the thread root at the top and no value attribute (uses counts).
|
StacktraceTreeModel(IItemCollection items,
FrameSeparator frameSeparator)
Builds a StacktraceTreeModel from a given collection of events with defaults: the thread root
at the top and no value attribute (uses counts).
|
StacktraceTreeModel(IItemCollection items,
FrameSeparator frameSeparator,
boolean invertedStacks)
Builds a StacktraceTreeModel from a given collection of events with no attribute specified
(uses occurrences to determine node weight).
|
StacktraceTreeModel(IItemCollection items,
FrameSeparator frameSeparator,
boolean invertedStacks,
IAttribute<IQuantity> attribute)
Builds a StacktraceTreeModel from a given collection of events.
|
Modifier and Type | Method and Description |
---|---|
private void |
addItem(IItem item,
IMemberAccessor<IMCStackTrace,IItem> stacktraceAccessor,
IMemberAccessor<IQuantity,IItem> quantityAccessor) |
private static <T> IMemberAccessor<T,IItem> |
getAccessor(IItemIterable iterable,
IAttribute<T> attr) |
IItemCollection |
getItems() |
private Node |
getOrCreateNode(Node parent,
AggregatableFrame frame) |
Node |
getRoot() |
private static final FrameSeparator DEFAULT_FRAME_SEPARATOR
private static final IMCFrame UNKNOWN_FRAME
A typical case is when a stacktrace is truncated due to to Flight Recorder settings. We know that there is a frame because of a truncation flag, but there is no information about it.
private static final IMCFrame ROOT_FRAME
We need to create this frame as a parent to all branches of the tree we want to represent.
private final IItemCollection items
private final FrameSeparator frameSeparator
private final IAttribute<IQuantity> attribute
private final boolean invertedStacks
private final Node root
public StacktraceTreeModel(IItemCollection items)
items
- the data we want to represent.public StacktraceTreeModel(IItemCollection items, FrameSeparator frameSeparator)
items
- the data we want to represent.frameSeparator
- defines what represents a node in the tree. Defaults to METHOD.public StacktraceTreeModel(IItemCollection items, FrameSeparator frameSeparator, boolean invertedStacks)
items
- the data we want to represent.frameSeparator
- defines what represents a node in the tree. Defaults to METHOD.invertedStacks
- defines how the stacks are aggregated. Defaults to false (i.e. bottom-up,
Thread.run() at the root of the tree).public StacktraceTreeModel(IItemCollection items, FrameSeparator frameSeparator, boolean invertedStacks, IAttribute<IQuantity> attribute)
items
- the data we want to represent.frameSeparator
- defines what represents a node in the tree. Defaults to METHOD.invertedStacks
- defines how the stacks are aggregated. Defaults to false (i.e. bottom-up,
Thread.run() at the root of the tree).attribute
- defines what we use as node weights. If null, the weight is the number of
occurrences for the frame.public Node getRoot()
public IItemCollection getItems()
private void addItem(IItem item, IMemberAccessor<IMCStackTrace,IItem> stacktraceAccessor, IMemberAccessor<IQuantity,IItem> quantityAccessor)
private Node getOrCreateNode(Node parent, AggregatableFrame frame)
private static <T> IMemberAccessor<T,IItem> getAccessor(IItemIterable iterable, IAttribute<T> attr)