Class StacktraceGraphModel
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.stacktrace.graph.StacktraceGraphModel
-
public final class StacktraceGraphModel extends Object
A model for holding multiple stack traces and their relations to each other as a directed graph.The model is state-less. The model is created and built once, and read only.
Instances of this class are thread safe.
The typical way of using this class is to first decide on the
FrameSeparator
and then create the model.Opening a Java flight Recording and setting up the stack trace model can be done like this:
IItemCollection items = JfrLoaderToolkit.loadEvents(file); IItemCollection filteredItems = items.apply(JdkFilters.EXECUTION_SAMPLE); FrameSeparator frameSeparator = new FrameSeparator(FrameCategorization.METHOD, false); StacktraceGraphModel model = new StacktraceGraphModel(frameSeparator, filteredItems);
-
-
Constructor Summary
Constructors Constructor Description StacktraceGraphModel(FrameSeparator frameSeparator, IItemCollection items, IAttribute<IQuantity> attribute)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
findEdgeMaxCount()
Searches the edges for the max count.double
findEdgeMaxValue()
Searches the edges for the max value.int
findEdgeMinCount()
Searches the edges for the min count.double
findEdgeMinValue()
Searches the edges for the min value.int
findNodeMaxCount()
Searches the nodes for the max count.double
findNodeMaxWeight()
Searches the nodes for the max weight.int
findNodeMinCount()
Searches the nodes for the min count.double
findNodeMinWeight()
Searches the nodes for the min weight.IAttribute<IQuantity>
getAttribute()
Collection<Edge>
getEdges()
IItemCollection
getItems()
Collection<Node>
getNodes()
int
getTotalEdgeCount()
int
getTotalTraceCount()
boolean
isEmpty()
static void
main(String[] args)
String
toString()
-
-
-
Constructor Detail
-
StacktraceGraphModel
public StacktraceGraphModel(FrameSeparator frameSeparator, IItemCollection items, IAttribute<IQuantity> attribute)
Constructor.- Parameters:
frameSeparator
- how to aggregate frames.items
- the items to graph.attribute
- the (optional) attribute to use for calculating the values.
-
-
Method Detail
-
getEdges
public Collection<Edge> getEdges()
-
getNodes
public Collection<Node> getNodes()
-
getAttribute
public IAttribute<IQuantity> getAttribute()
-
isEmpty
public boolean isEmpty()
-
getItems
public IItemCollection getItems()
-
getTotalEdgeCount
public int getTotalEdgeCount()
- Returns:
- the total edge count, i.e. the total sum of counts for all edges.
-
getTotalTraceCount
public int getTotalTraceCount()
- Returns:
- the total amount of stack traces use to build this model.
-
findNodeMinCount
public int findNodeMinCount()
Searches the nodes for the min count.- Returns:
- the min count.
-
findNodeMaxCount
public int findNodeMaxCount()
Searches the nodes for the max count.- Returns:
- the max count.
-
findNodeMinWeight
public double findNodeMinWeight()
Searches the nodes for the min weight.- Returns:
- the min weight.
-
findNodeMaxWeight
public double findNodeMaxWeight()
Searches the nodes for the max weight.- Returns:
- the max weight.
-
findEdgeMinValue
public double findEdgeMinValue()
Searches the edges for the min value.- Returns:
- the min value.
-
findEdgeMaxValue
public double findEdgeMaxValue()
Searches the edges for the max value.- Returns:
- the max value.
-
findEdgeMinCount
public int findEdgeMinCount()
Searches the edges for the min count.- Returns:
- the min count.
-
findEdgeMaxCount
public int findEdgeMaxCount()
Searches the edges for the max count.- Returns:
- the max count.
-
main
public static void main(String[] args) throws IOException, CouldNotLoadRecordingException
-
-