Search in sources :

Example 1 with Indicator

use of org.entcore.common.aggregation.indicators.Indicator in project statistics by OPEN-ENT-NG.

the class IndicatorFactory method getAccessIndicator.

// Access to applications
public static Indicator getAccessIndicator(Collection<IndicatorFilterMongoImpl> filters, Date pWriteDate) {
    Collection<IndicatorGroup> indicatorGroups = new ArrayList<IndicatorGroup>();
    indicatorGroups.add(new IndicatorGroup(TRACE_FIELD_MODULE).addAndReturnChild(new IndicatorGroup(TRACE_FIELD_STRUCTURES).setArray(true)).addAndReturnChild(TRACE_FIELD_PROFILE));
    Indicator indicator = new IndicatorMongoImpl(TRACE_TYPE_SVC_ACCESS, filters, indicatorGroups);
    indicator.setWriteDate(pWriteDate);
    return indicator;
}
Also used : IndicatorGroup(org.entcore.common.aggregation.groups.IndicatorGroup) ArrayList(java.util.ArrayList) IndicatorMongoImpl(org.entcore.common.aggregation.indicators.mongo.IndicatorMongoImpl) Indicator(org.entcore.common.aggregation.indicators.Indicator)

Example 2 with Indicator

use of org.entcore.common.aggregation.indicators.Indicator in project statistics by OPEN-ENT-NG.

the class IndicatorFactory method getConnectionIndicator.

// Connections
public static Indicator getConnectionIndicator(Collection<IndicatorFilterMongoImpl> filters, Date pWriteDate) {
    Collection<IndicatorGroup> indicatorGroups = new ArrayList<IndicatorGroup>();
    indicatorGroups.add(new IndicatorGroup(TRACE_FIELD_STRUCTURES).setArray(true).addAndReturnChild(TRACE_FIELD_PROFILE));
    Indicator indicator = new IndicatorMongoImpl(TRACE_TYPE_CONNEXION, filters, indicatorGroups);
    indicator.setWriteDate(pWriteDate);
    return indicator;
}
Also used : IndicatorGroup(org.entcore.common.aggregation.groups.IndicatorGroup) ArrayList(java.util.ArrayList) IndicatorMongoImpl(org.entcore.common.aggregation.indicators.mongo.IndicatorMongoImpl) Indicator(org.entcore.common.aggregation.indicators.Indicator)

Example 3 with Indicator

use of org.entcore.common.aggregation.indicators.Indicator in project statistics by OPEN-ENT-NG.

the class AggregationProcessingSequentialImpl method process.

@Override
public void process(final Handler<JsonObject> callBack) {
    if (indicators == null && indicators.isEmpty()) {
        log.warn("indicators is empty. Nothing was processed");
        return;
    }
    final Iterator<Indicator> it = indicators.iterator();
    Indicator indicator = it.next();
    // Agregate indicators one after the other
    indicator.aggregate(new Handler<JsonObject>() {

        @Override
        public void handle(JsonObject event) {
            if (it.hasNext()) {
                it.next().aggregate(this);
            } else {
                callBack.handle(event);
            }
        }
    });
}
Also used : JsonObject(org.vertx.java.core.json.JsonObject) Indicator(org.entcore.common.aggregation.indicators.Indicator)

Aggregations

Indicator (org.entcore.common.aggregation.indicators.Indicator)3 ArrayList (java.util.ArrayList)2 IndicatorGroup (org.entcore.common.aggregation.groups.IndicatorGroup)2 IndicatorMongoImpl (org.entcore.common.aggregation.indicators.mongo.IndicatorMongoImpl)2 JsonObject (org.vertx.java.core.json.JsonObject)1