tmf: fix the ctf parser benchmark
authorVincent Perot <vincent.perot@ericsson.com>
Thu, 17 Jul 2014 19:48:54 +0000 (15:48 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 18 Jul 2014 17:33:06 +0000 (13:33 -0400)
Change-Id: Ieabefd01a81608ffee475bd114160b1e50df34ed
Signed-off-by: Vincent Perot <vincent.perot@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/30085
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
org.eclipse.linuxtools.ctf.core.tests/perf/org/eclipse/linuxtools/ctf/core/tests/perf/trace/TraceSeekBenchmark.java

index 91f890ec3ce8702957e50a6d00c9412873918108..be8fc8254b6c0ca21a24677b2ed49fcc2a528de4 100644 (file)
@@ -91,7 +91,11 @@ public class TraceSeekBenchmark {
                 List<Long> seekTimestamps = new LinkedList<>();
                 final long range = endTime - startTime;
                 for (int i = 0; i < NB_SEEKS; i++) {
-                    seekTimestamps.add(startTime + (RND.nextLong() % range));
+                    long delta = (RND.nextLong() % range);
+                    if (delta < 0) {
+                        delta += range;
+                    }
+                    seekTimestamps.add(startTime + delta);
                 }
 
                 /* Benchmark seeking to the generated timestamps */
This page took 0.024888 seconds and 5 git commands to generate.