use of org.apache.synapse.aspects.flow.statistics.log.templates.StatisticsCloseEvent in project wso2-synapse by wso2.
the class CloseEventCollector method closeEntryEvent.
/**
* Enqueue statistics event to the event queue. This method receives statistics events from synapse mediation
* engine for all the component types.
*
* @param messageContext synapse message context.
* @param componentName name of the component reporting statistics.
* @param componentType component type of the reporting component.
* @param currentIndex component's level in this message flow.
* @param isContentAltering true if content is altered
* @param propertyValue value of the property
*/
public static void closeEntryEvent(MessageContext messageContext, String componentName, ComponentType componentType, Integer currentIndex, boolean isContentAltering, String propertyValue) {
if (shouldReportStatistic(messageContext)) {
Boolean isCollectingTracing = (Boolean) messageContext.getProperty(StatisticsConstants.FLOW_TRACE_IS_COLLECTED);
StatisticDataUnit statisticDataUnit = new StatisticDataUnit();
if (propertyValue != null) {
statisticDataUnit.setPropertyValue(propertyValue);
}
statisticDataUnit.setComponentName(componentName);
statisticDataUnit.setComponentType(componentType);
if (currentIndex == null) {
statisticDataUnit.setShouldTrackParent(true);
statisticDataUnit.setCurrentIndex(StatisticDataCollectionHelper.getParentFlowPosition(messageContext, null));
statisticDataUnit.setContinuationCall(true);
} else {
statisticDataUnit.setCurrentIndex(currentIndex);
}
StatisticDataCollectionHelper.collectData(messageContext, isContentAltering, isCollectingTracing, statisticDataUnit);
StatisticsCloseEvent closeEvent = new StatisticsCloseEvent(statisticDataUnit);
if (currentIndex == null) {
addEvent(messageContext, closeEvent);
} else {
addEventAndDecrementCount(messageContext, closeEvent);
}
if (isOpenTracingEnabled()) {
OpenTracingManagerHolder.getOpenTracingManager().getHandler().handleCloseEntryEvent(statisticDataUnit, messageContext);
}
}
}
Aggregations