X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=benchmark%2Fntfbenchmark%2Fsrc%2Fmain%2Fjava%2Fntfbenchmark%2Fimpl%2FNtfbenchmarkProvider.java;h=50b0478628beb68ff332ba738b28f7b78c20c1eb;hb=4588c8fc9faaf73b84fdcf63d9be82e14087dffe;hp=c11f676dafd1cf9412236ea836340d53d9df601a;hpb=4eafc030622cc6dc155c452b6c6547eac7b5b616;p=controller.git diff --git a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java index c11f676daf..50b0478628 100644 --- a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java +++ b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java @@ -7,6 +7,8 @@ */ 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; @@ -14,8 +16,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.binding.api.NotificationService; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.NtfbenchmarkService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput.ProducerType; @@ -26,6 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench 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; @@ -83,7 +86,8 @@ public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService 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 { @@ -106,7 +110,6 @@ public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService allListeners += listenerRegistration.getInstance().getReceived(); } - final long listenerEndTime = System.nanoTime(); final long listenerElapsedTime = producerEndTime - startTime; LOG.info("Test Done"); @@ -118,13 +121,14 @@ public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService 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 {