public static ThroughputTracker createThroughputTracker(SiddhiAppContext siddhiAppContext, String name,
                                                            String type, String function) {
        ThroughputTracker throughputTracker = null;
        if (siddhiAppContext.getStatisticsManager() != null) {
            String metricName =
                    siddhiAppContext.getSiddhiContext().getStatisticsConfiguration().getMetricPrefix() +
                            SiddhiConstants.METRIC_DELIMITER + SiddhiConstants.METRIC_INFIX_SIDDHI_APPS +
                            SiddhiConstants.METRIC_DELIMITER + siddhiAppContext.getName() +
                            SiddhiConstants.METRIC_DELIMITER + SiddhiConstants.METRIC_INFIX_SIDDHI +
                            SiddhiConstants.METRIC_DELIMITER + type +
                            SiddhiConstants.METRIC_DELIMITER + name;
            if (function != null) {
                metricName += SiddhiConstants.METRIC_DELIMITER + function;
            }
            metricName += SiddhiConstants.METRIC_DELIMITER + "throughput";
            boolean matchExist = false;
            for (String regex : siddhiAppContext.getIncludedMetrics()) {
                if (metricName.matches(regex)) {
                    matchExist = true;
                    break;
                }
            }
            if (matchExist) {
                throughputTracker = siddhiAppContext
                        .getSiddhiContext()
                        .getStatisticsConfiguration()
                        .getFactory()
                        .createThroughputTracker(metricName, siddhiAppContext.getStatisticsManager());
            }
        }
        return throughputTracker;
    }
Helper method to clean/refactor MetaStreamEvent.

@param metaStreamEvent MetaStreamEvent
modules/siddhi-core/src/main/java/io/siddhi/core/util/parser/helper/QueryParserHelper.java