@Test public void testConvertsTimeUnits() { TimeFractionDeltaEnricher<Integer> enricher = new TimeFractionDeltaEnricher<Integer>(producer, intSensor, fractionSensor, TimeUnit.MICROSECONDS); producer.enrichers().add(enricher); enricher.onEvent(new BasicSensorEvent<Integer>(intSensor, producer, 0, 1000000L)); enricher.onEvent(new BasicSensorEvent<Integer>(intSensor, producer, 1000000, 1001000L)); assertEquals(producer.getAttribute(fractionSensor), 1d); }
@Override public void onEvent(SensorEvent<T> event) { onEvent(event, event.getTimestamp()); }
TimeFractionDeltaEnricher extends AbstractTypeTransformingEnricher<T,Double> { @Override public void onEvent(SensorEvent<T> event) { onEvent(event, event.getTimestamp()); } }
TimeFractionDeltaEnricher extends AbstractTypeTransformingEnricher<T,Double> { @Override public void onEvent(SensorEvent<T> event) { onEvent(event, event.getTimestamp()); } TimeFractionDeltaEnricher();  TimeFractionDeltaEnricher(Entity producer, Sensor<T> source, Sensor<Double> target, TimeUnit origUnits);  TimeFractionDeltaEnricher(Entity producer, Sensor<T> source, Sensor<Double> target, long nanosPerOrigUnit); }
TimeFractionDeltaEnricher extends AbstractTypeTransformingEnricher<T,Double> { @Override public void onEvent(SensorEvent<T> event) { onEvent(event, event.getTimestamp()); } TimeFractionDeltaEnricher();  TimeFractionDeltaEnricher(Entity producer, Sensor<T> source, Sensor<Double> target, TimeUnit origUnits);  TimeFractionDeltaEnricher(Entity producer, Sensor<T> source, Sensor<Double> target, long nanosPerOrigUnit); @Override void onEvent(SensorEvent<T> event); void onEvent(SensorEvent<T> event, long eventTimestamp); }
TimeFractionDeltaEnricher extends AbstractTypeTransformingEnricher<T,Double> { @Override public void onEvent(SensorEvent<T> event) { onEvent(event, event.getTimestamp()); } TimeFractionDeltaEnricher();  TimeFractionDeltaEnricher(Entity producer, Sensor<T> source, Sensor<Double> target, TimeUnit origUnits);  TimeFractionDeltaEnricher(Entity producer, Sensor<T> source, Sensor<Double> target, long nanosPerOrigUnit); @Override void onEvent(SensorEvent<T> event); void onEvent(SensorEvent<T> event, long eventTimestamp);  }