Class StacktraceGraphModel
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.stacktrace.graph.StacktraceGraphModel
-
public final class StacktraceGraphModel extends java.lang.ObjectA 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
FrameSeparatorand 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 intfindEdgeMaxCount()Searches the edges for the max count.doublefindEdgeMaxValue()Searches the edges for the max value.intfindEdgeMinCount()Searches the edges for the min count.doublefindEdgeMinValue()Searches the edges for the min value.intfindNodeMaxCount()Searches the nodes for the max count.doublefindNodeMaxWeight()Searches the nodes for the max weight.intfindNodeMinCount()Searches the nodes for the min count.doublefindNodeMinWeight()Searches the nodes for the min weight.IAttribute<IQuantity>getAttribute()java.util.Collection<Edge>getEdges()IItemCollectiongetItems()java.util.Collection<Node>getNodes()intgetTotalEdgeCount()intgetTotalTraceCount()booleanisEmpty()static voidmain(java.lang.String[] args)java.lang.StringtoString()
-
-
-
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 java.util.Collection<Edge> getEdges()
-
getNodes
public java.util.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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, CouldNotLoadRecordingException- Throws:
java.io.IOExceptionCouldNotLoadRecordingException
-
-