use of org.apache.synapse.aspects.flow.statistics.opentracing.models.ContinuationStateSequenceInfo in project wso2-synapse by wso2.
the class JaegerSpanHandler method cleanupContinuationStateSequences.
/**
* Cleans up remaining unfinished continuation state sequences before ending the outer level span.
* @param spanStore Span store object.
*/
private void cleanupContinuationStateSequences(SpanStore spanStore) {
if (!spanStore.getContinuationStateSequenceInfos().isEmpty()) {
List<ContinuationStateSequenceInfo> continuationStateSequences = spanStore.getContinuationStateSequenceInfos();
for (ContinuationStateSequenceInfo continuationStateSequence : continuationStateSequences) {
finishSpanForContinuationStateSequence(continuationStateSequence, spanStore);
}
continuationStateSequences.clear();
}
}
use of org.apache.synapse.aspects.flow.statistics.opentracing.models.ContinuationStateSequenceInfo in project wso2-synapse by wso2.
the class JaegerSpanHandler method handleStateStackClearance.
@Override
public void handleStateStackClearance(MessageContext synCtx) {
TracingScope tracingScope = tracingScopeManager.getTracingScope(synCtx);
synchronized (tracingScope.getSpanStore()) {
List<ContinuationStateSequenceInfo> stackedSequences = tracingScope.getSpanStore().getContinuationStateSequenceInfos();
for (ContinuationStateSequenceInfo stackedSequence : stackedSequences) {
finishSpanForContinuationStateSequence(stackedSequence, tracingScope.getSpanStore());
}
stackedSequences.clear();
}
}
use of org.apache.synapse.aspects.flow.statistics.opentracing.models.ContinuationStateSequenceInfo in project wso2-synapse by wso2.
the class JaegerSpanHandler method bufferSequenceContinuationState.
/**
* Buffers the given statistic data unit which is reported by an open event,
* until an appropriate continuation stack event is reported.
* A continuation event does not have the information about statistic data units to start and stop spans,
* and that information can only be obtained from this buffered open event.
* @param statisticDataUnit Statistic data unit object.
* @param spanStore Span store object.
*/
private void bufferSequenceContinuationState(StatisticDataUnit statisticDataUnit, SpanStore spanStore) {
ContinuationStateSequenceInfo continuationStateSequenceInfo = new ContinuationStateSequenceInfo(statisticDataUnit);
spanStore.addContinuationStateSequenceInfo(continuationStateSequenceInfo);
}
use of org.apache.synapse.aspects.flow.statistics.opentracing.models.ContinuationStateSequenceInfo in project wso2-synapse by wso2.
the class JaegerSpanHandler method handleStateStackRemoval.
@Override
public void handleStateStackRemoval(ContinuationState continuationState, MessageContext synCtx) {
TracingScope tracingScope = tracingScopeManager.getTracingScope(synCtx);
synchronized (tracingScope.getSpanStore()) {
if (continuationState instanceof SeqContinuationState) {
// No other type will be kept track of
ContinuationStateSequenceInfo continuationStateSequenceInfo = findContinuationStateSequenceInfo(((SeqContinuationState) continuationState).getSeqType(), tracingScope.getSpanStore(), true);
if (continuationStateSequenceInfo != null) {
continuationStateSequenceInfo.setSpanActive(false);
finishSpanForContinuationStateSequence(continuationStateSequenceInfo, tracingScope.getSpanStore());
tracingScope.getSpanStore().getContinuationStateSequenceInfos().remove(continuationStateSequenceInfo);
}
}
}
}
use of org.apache.synapse.aspects.flow.statistics.opentracing.models.ContinuationStateSequenceInfo in project wso2-synapse by wso2.
the class JaegerSpanHandler method handleStateStackInsertion.
@Override
public void handleStateStackInsertion(MessageContext synCtx, String seqName, SequenceType seqType) {
TracingScope tracingScope = tracingScopeManager.getTracingScope(synCtx);
synchronized (tracingScope.getSpanStore()) {
ContinuationStateSequenceInfo continuationStateSequenceInfo = findContinuationStateSequenceInfo(seqType, tracingScope.getSpanStore(), false);
if (continuationStateSequenceInfo != null) {
StatisticDataUnit statisticDataUnit = continuationStateSequenceInfo.getStatisticDataUnit();
continuationStateSequenceInfo.setSpanActive(true);
startSpan(statisticDataUnit, synCtx, tracingScope.getSpanStore());
}
}
}
Aggregations