Package com.smeup.kokos.sdk.rpgle.util
Class TraceStack
java.lang.Object
com.smeup.kokos.sdk.rpgle.util.TraceStack
- All Implemented Interfaces:
AutoCloseable
- Author:
- Domenico Mancini (APU002)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this stack can report more traces or not.voidcleanup()Close all opened spans and reset the stack state.voidclose()booleanClose the latest opened trace.booleaninspectAndClose(Consumer<com.smeup.kokos.sdk.trace.SmeupSpan> inspector) Inspect the last span of latest opened trace and consumes it.booleanisEmpty()Returnstruewhen the stack is empty.booleanReturnstruewhen the stack is not empty.voidOpen a new named trace.intsize()Get the number of currently opened spans.
-
Constructor Details
-
TraceStack
public TraceStack() -
TraceStack
public TraceStack(int maxAllowed) -
TraceStack
-
-
Method Details
-
getIdentifierName
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
size
public int size()Get the number of currently opened spans. -
isEmpty
public boolean isEmpty()Returnstruewhen the stack is empty. -
isNotEmpty
public boolean isNotEmpty()Returnstruewhen the stack is not empty. -
canRecord
public boolean canRecord()Whether this stack can report more traces or not. -
openTrace
Open a new named trace.- Parameters:
name- The name of the trace.
-
closeTrace
public boolean closeTrace()Close the latest opened trace. -
inspectAndClose
Inspect the last span of latest opened trace and consumes it. Close the latest opened trace.- Parameters:
inspector- The consumer ofSmeupSpans.
-
cleanup
public void cleanup()Close all opened spans and reset the stack state.
-