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;
}
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;
}
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);
}
}
});
}
Aggregations