@Override
    public Expression[] getBaseAggregators() {
        Expression countAggregator = Expression.function("sum",
                Expression.variable(getBaseAttributes()[0].getName()));
        return new Expression[]{countAggregator};
    }
{@link IncrementalAttributeAggregator} to calculate count based on an event attribute.
modules/siddhi-core/src/main/java/io/siddhi/core/query/selector/attribute/aggregator/incremental/CountIncrementalAttributeAggregator.java