*/
package ntfbenchmark.impl;
+import static com.google.common.base.Verify.verifyNotNull;
+
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final long startTime = System.nanoTime();
for (int i = 0; i < input.getProducers().intValue(); i++) {
- executor.submit(producers.get(i));
+ // FIXME: fools RV_RETURN_VALUE_IGNORED_BAD_PRACTICE for now, but we should check some more
+ verifyNotNull(executor.submit(producers.get(i)));
}
executor.shutdown();
try {
allListeners += listenerRegistration.getInstance().getReceived();
}
- final long listenerEndTime = System.nanoTime();
final long listenerElapsedTime = producerEndTime - startTime;
LOG.info("Test Done");
final StartTestOutput output =
new StartTestOutputBuilder()
- .setProducerElapsedTime(producerElapsedTime / 1000000)
- .setListenerElapsedTime(listenerElapsedTime / 1000000)
- .setListenerOk(allListeners)
- .setProducerOk(allProducersOk)
- .setProducerError(allProducersError)
- .setProducerRate((allProducersOk + allProducersError) * 1000000000 / producerElapsedTime)
- .setListenerRate(allListeners * 1000000000 / listenerElapsedTime)
+ .setProducerElapsedTime(Uint32.valueOf(producerElapsedTime / 1000000))
+ .setListenerElapsedTime(Uint32.valueOf(listenerElapsedTime / 1000000))
+ .setListenerOk(Uint32.valueOf(allListeners))
+ .setProducerOk(Uint32.valueOf(allProducersOk))
+ .setProducerError(Uint32.valueOf(allProducersError))
+ .setProducerRate(Uint32.valueOf((allProducersOk + allProducersError) * 1000000000
+ / producerElapsedTime))
+ .setListenerRate(Uint32.valueOf(allListeners * 1000000000 / listenerElapsedTime))
.build();
return RpcResultBuilder.success(output).buildFuture();
} finally {