Class HistogramInstructionTracer.Histogram

java.lang.Object
com.oracle.truffle.api.bytecode.debug.HistogramInstructionTracer.Histogram
Enclosing class:
HistogramInstructionTracer

public static final class HistogramInstructionTracer.Histogram extends Object
Represents a hierarchical histogram that can group instruction counts by arbitrary attributes. A histogram is an immutable snapshot of the counters at the time it was created.
Since:
25.1
  • Method Details

    • getCounters

      public Map<InstructionDescriptor, Long> getCounters()
      Returns the per-instruction counts for this histogram level when it is a leaf.

      If this histogram has subgroups, this map may be empty, since counts then live in the children.

      Returns:
      an unmodifiable map from InstructionDescriptor to count
      Since:
      25.1
    • getStatistics

      Returns aggregated statistics across this histogram level.

      For leaf histograms, this wraps each count in a LongSummaryStatistics. For parent histograms, statistics are combined across all children.

      Returns:
      a map from InstructionDescriptor to aggregated statistics
      Since:
      25.1
    • getGroups

      Returns the subgroups of this histogram, keyed by the grouping values produced by the configured HistogramInstructionTracer.GroupClauses.
      Returns:
      an unmodifiable map of subgroup keys to child histograms, or null if there are no groups
      Since:
      25.1
    • dump

      public String dump()
      Renders this histogram to a string using print(PrintStream).
      Returns:
      a human readable histogram table
      Since:
      25.1
    • print

      public void print(PrintStream out)
      Prints this histogram as a single indented table.

      Numeric columns are aligned. When groups are present, each group is shown as a row that displays the total for the group, followed by the indented rows of its children.

      Parameters:
      out - the stream to print to
      Since:
      25.1
    • getInstructionsExecuted

      public long getInstructionsExecuted()
      Returns the total number of executed instructions represented by this histogram.

      For grouped histograms, this is the sum across all children. For leaves, this is the sum of the per-instruction counts.

      Returns:
      the total count represented by this histogram
      Since:
      25.1