Class DiagnosticAttributeInterceptor

java.lang.Object
io.higson.runtime.profiler.callstack.DiagnosticAttributeInterceptor
All Implemented Interfaces:
AttributeInterceptor

public class DiagnosticAttributeInterceptor extends Object implements AttributeInterceptor
Diagnostic (profiling) implementation of AttributeInterceptor.

Wraps every domain-attribute resolution in a DOMAIN_ATTRIBUTE call-stack frame. When the attribute is the top-level entry point (stack empty before push) the collected events are aggregated into a summary and handed to the DiagnosticCallStackFlushStrategy. The strategy decides whether to dispatch the report to the diagnostic queue (production) or preserve the stack for later inspection (tester).

An optional delegate AttributeInterceptor may be supplied at construction time: its getValue is called inside the diagnostic frame instead of going directly to the resolver — so all engine calls made by the user interceptor are captured as children of the DOMAIN_ATTRIBUTE frame. When no delegate is supplied a no-op one is used (it forwards straight to the resolver), so chaining is allocation-free per call.

The elementName recorded in the frame is built as objectPath + "{" + attrCode + "}", e.g. "/vehicles/car{RATE}", using DomainAttribute.getDomainObject() and its getPath() method. The attribute code is wrapped in {} to visually distinguish it from path segments.

Registered by HigsonEngineFactory only when profilerEnabled = true.