Class 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 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

      • isEmpty

        public boolean isEmpty()
      • 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.