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.

@FunctionalInterface public interface DiagnosticCallStackFlushStrategy
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:

  • 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 element
      summary - aggregated call-stack summary generated from the current thread-local stack
      instanceId - identifier of the runtime engine instance that produced the report