Interface DiagnosticCallStackFlushStrategy
- All Known Implementing Classes:
NoopDiagnosticCallStackFlushStrategy,QueueDiagnosticCallStackFlushStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy for flushing a completed call-stack report.
Implementations decide what to do with the collected DiagnosticCallStackSummary
once the top-level profiling frame has closed. The contract also covers lifecycle of the
thread-local DiagnosticCallStack: if the strategy needs the stack to survive after
flush (e.g. the tester reads it later via stopDiagnostic), it must NOT clear it.
If it dispatches the report to an external queue and the stack is no longer needed, it SHOULD
call DiagnosticCallStack.clear() as the last step inside flush.
Two built-in implementations are provided:
QueueDiagnosticCallStackFlushStrategy— production default: creates aDiagnosticCallStackReport, enqueues it on theDiagnosticQueue, then clears the stack.NoopDiagnosticCallStackFlushStrategy— tester variant: does nothing; the tester reads the stack directly viaDiagnosticParamService#stopDiagnosticand clears it afterwards.
-
Method Summary
Modifier and TypeMethodDescriptionvoidflush(String elementName, DiagnosticCallStackEvent.ElementType elementType, DiagnosticCallStackSummary summary, String instanceId) Called once the top-level profiling frame has finished.
-
Method Details
-
flush
void flush(String elementName, DiagnosticCallStackEvent.ElementType elementType, DiagnosticCallStackSummary summary, String instanceId) Called once the top-level profiling frame has finished.- Parameters:
elementName- name of the top-level element (parameter / function / flow / attribute path)elementType- type of the top-level elementsummary- aggregated call-stack summary generated from the current thread-local stackinstanceId- identifier of the runtime engine instance that produced the report
-