Class HistogramInstructionTracer.Builder
java.lang.Object
com.oracle.truffle.api.bytecode.debug.HistogramInstructionTracer.Builder
- Enclosing class:
HistogramInstructionTracer
Builder for
HistogramInstructionTracer.
The builder supports an optional filter predicate and an ordered list of group clauses. Group clauses are applied in the order they are added, producing a hierarchy of groups.
- Since:
- 25.1
-
Method Summary
Modifier and TypeMethodDescriptionbuild(BytecodeDescriptor<?, ?, ?> descriptor) Builds aHistogramInstructionTracerfor the givenBytecodeDescriptor.filter(Predicate<BytecodeNode> filterClause) Sets an optional filter predicate.Adds a grouping clause to the histogram.
-
Method Details
-
filter
Sets an optional filter predicate. If present, only bytecode nodes that satisfy the predicate contribute to counters.- Parameters:
filterClause- the predicate to apply, may benull- Returns:
- this builder
- Since:
- 25.1
-
groupBy
Adds a grouping clause to the histogram. Multiple clauses create a hierarchy, the first clause forms the top level, the last clause forms the leaves.- Parameters:
clause- the grouping clause to add, must not benull- Returns:
- this builder
- Throws:
NullPointerException- ifclauseisnull- Since:
- 25.1
-
build
Builds aHistogramInstructionTracerfor the givenBytecodeDescriptor.- Parameters:
descriptor- the descriptor to attach to- Returns:
- a new tracer configured with the previously set filter and groups
- Since:
- 25.1
-