*/
@Override
public void configure() {
/* PE that prints counts to console. */
PEMaker printPE = addPE(PrintPE.class);
/* PEs that count events by user, gender, and age. */
PEMaker userCountPE = addPE(CounterPE.class);
userCountPE.addTrigger().fireOn(Event.class).ifInterval(100l, TimeUnit.MILLISECONDS);
PEMaker genderCountPE = addPE(CounterPE.class);
genderCountPE.addTrigger().fireOn(Event.class).ifInterval(100l, TimeUnit.MILLISECONDS);
PEMaker ageCountPE = addPE(CounterPE.class);
ageCountPE.addTrigger().fireOn(Event.class).ifInterval(100l, TimeUnit.MILLISECONDS);
generateUserEventPE = addPE(GenerateUserEventPE.class).asSingleton();
generateUserEventPE.addTimer().withDuration(1, TimeUnit.MILLISECONDS);
ageCountPE.emit(CountEvent.class).onKey(new CountKeyFinder()).to(printPE);
genderCountPE.emit(CountEvent.class).onKey(new CountKeyFinder()).to(printPE);
userCountPE.emit(CountEvent.class).onKey(new CountKeyFinder()).to(printPE);
generateUserEventPE.emit(UserEvent.class).onKey(new AgeKeyFinder()).to(ageCountPE);
generateUserEventPE.emit(UserEvent.class).onKey("gender").to(genderCountPE);