public void run(String[] args) throws Exception { long tStart = System.currentTimeMillis(); ControllableRunner runner = new ControllableRunner(new MappedFileSource(args[0])).runWith(this); runner.tick(); runner.halt(); long tMatch = System.currentTimeMillis() - tStart; log.info("total time taken: {}s", (tMatch) / 1000.0); }
public void runControlled(String[] args) throws Exception { long tStart = System.currentTimeMillis(); ControllableRunner runner = new ControllableRunner(new MappedFileSource(args[0])).runWith(this); while(!runner.isAtEnd()) { runner.tick(); } long tMatch = System.currentTimeMillis() - tStart; log.info("total time taken: {}s", (tMatch) / 1000.0); }
public void runSeek(String[] args) throws Exception { ControllableRunner runner = new ControllableRunner(new MappedFileSource(args[0])).runWith(this); int lastTick = runner.getLastTick(); Random r = new Random(); int i = N_SEEKS; try { long tStart = System.nanoTime(); while (i-- > 0) { int nextTick = r.nextInt(lastTick); log.warn("seeking to {}", nextTick); runner.seek(nextTick); } long tTick = System.nanoTime() - tStart; double tMs = tTick / 1000000.0d; log.warn("{} seek operations took {}ms, {}ms/seek", N_SEEKS, tMs, tMs / N_SEEKS); } finally { runner.halt(); } }
public void runSeek(String[] args) throws Exception { ControllableRunner runner = new ControllableRunner(new MappedFileSource(args[0])).runWith(this); runner.seek(30000); System.out.println("at 30000\n\n"); runner.seek(0); System.out.println("at 0\n\n"); runner.halt(); }
public Main(String fileName) throws IOException, InterruptedException { runner = new ControllableRunner(new MappedFileSource(fileName)).runWith(this); runner.seek(runner.getLastTick()); runner.halt(); }