Class HistogramInstructionTracer.Histogram
java.lang.Object
com.oracle.truffle.api.bytecode.debug.HistogramInstructionTracer.Histogram
- Enclosing class:
HistogramInstructionTracer
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 Summary
Modifier and TypeMethodDescriptiondump()Renders this histogram to a string usingprint(PrintStream).Returns the per-instruction counts for this histogram level when it is a leaf.Returns the subgroups of this histogram, keyed by the grouping values produced by the configuredHistogramInstructionTracer.GroupClauses.longReturns the total number of executed instructions represented by this histogram.Returns aggregated statistics across this histogram level.voidprint(PrintStream out) Prints this histogram as a single indented table.
-
Method Details
-
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
InstructionDescriptorto 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
InstructionDescriptorto aggregated statistics - Since:
- 25.1
-
getGroups
Returns the subgroups of this histogram, keyed by the grouping values produced by the configuredHistogramInstructionTracer.GroupClauses.- Returns:
- an unmodifiable map of subgroup keys to child histograms, or
nullif there are no groups - Since:
- 25.1
-
dump
Renders this histogram to a string usingprint(PrintStream).- Returns:
- a human readable histogram table
- Since:
- 25.1
-
print
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
-