Package com.helix.profiler.node
Class AstNodeProfiler
java.lang.Object
com.helix.profiler.node.AstNodeProfiler
High-performance, thread-safe AST node profiler capturing per-node execution telemetry.
Emits ultra-low-overhead runtime hooks (< 5 ns) invoked directly from compiled bytecode to track execution frequency, execution latencies, failure/short-circuit rates, and cost-to-failure ratios used by adaptive AST optimizers and JFR telemetry.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidEmits custom JFR HelixNodeProfileEvents for all currently recorded nodes.static voidemitJfrEvent(String ruleName, String nodeId) Emits a custom JFR HelixNodeProfileEvent for the specified node.getNodeStats(String nodeId) getStatsForRule(String ruleName) static booleanstatic voidDirect telemetry recording helper.static voidrecordEntry(String nodeId) Entry hook invoked directly from compiled bytecode prior to node evaluation.static voidrecordExit(String nodeId, boolean result) Exit hook invoked directly from compiled bytecode immediately following node evaluation.static voidrecordExit(String nodeId, boolean result, long startNanos) Exit hook with explicit start timestamp.static NodeStatsregisterNode(String ruleName, String nodeId) Pre-registers a node for a given rule.static voidreset()Clears all telemetry statistics and node mappings.static voidsetEnabled(boolean isEnabled)
-
Method Details
-
isEnabled
public static boolean isEnabled() -
setEnabled
public static void setEnabled(boolean isEnabled) -
registerNode
Pre-registers a node for a given rule.- Parameters:
ruleName- associated rule namenodeId- unique node identifier- Returns:
- initialized NodeStats
-
record
Direct telemetry recording helper.- Parameters:
ruleName- rule identifiernodeId- node identifierelapsedNanos- elapsed duration in nanosecondsresult- evaluation outcome (false = short-circuit / failure)
-
recordEntry
Entry hook invoked directly from compiled bytecode prior to node evaluation.- Parameters:
nodeId- unique node identifier
-
recordExit
Exit hook invoked directly from compiled bytecode immediately following node evaluation.- Parameters:
nodeId- unique node identifierresult- evaluation outcome
-
recordExit
Exit hook with explicit start timestamp. -
getNodeStats
-
getAllStats
-
getStatsForRule
-
emitJfrEvent
Emits a custom JFR HelixNodeProfileEvent for the specified node.- Parameters:
ruleName- rule identifiernodeId- node identifier
-
emitAllJfrEvents
public static void emitAllJfrEvents()Emits custom JFR HelixNodeProfileEvents for all currently recorded nodes. -
reset
public static void reset()Clears all telemetry statistics and node mappings.
-