Package org.elasticsearch.common

Examples of org.elasticsearch.common.StopWatch.start()


        String name1 = "Task 1";
        String name2 = "Task 2";

        long fudgeFactor = 5L;
        assertThat(sw.isRunning(), equalTo(false));
        sw.start(name1);
        Thread.sleep(int1);
        assertThat(sw.isRunning(), equalTo(true));
        sw.stop();

        // TODO are timings off in JUnit? Why do these assertions sometimes fail
View Full Code Here


        // TODO are timings off in JUnit? Why do these assertions sometimes fail
        // under both Ant and Eclipse?

        //assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1);
        //assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + fudgeFactor);
        sw.start(name2);
        Thread.sleep(int2);
        sw.stop();
        //assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() >= int1 + int2);
        //assertTrue("Unexpected timing " + sw.getTotalTime(), sw.getTotalTime() <= int1 + int2 + fudgeFactor);
View Full Code Here

    }

    @Test public void testRejectsStartTwice() {
        StopWatch sw = new StopWatch();
        try {
            sw.start("");
            sw.stop();
            sw.start("");
            assertThat(sw.isRunning(), equalTo(true));
            sw.start("");
            assertThat("Can't start twice", false, equalTo(true));
View Full Code Here

    @Test public void testRejectsStartTwice() {
        StopWatch sw = new StopWatch();
        try {
            sw.start("");
            sw.stop();
            sw.start("");
            assertThat(sw.isRunning(), equalTo(true));
            sw.start("");
            assertThat("Can't start twice", false, equalTo(true));
        } catch (IllegalStateException ex) {
            // Ok
View Full Code Here

        try {
            sw.start("");
            sw.stop();
            sw.start("");
            assertThat(sw.isRunning(), equalTo(true));
            sw.start("");
            assertThat("Can't start twice", false, equalTo(true));
        } catch (IllegalStateException ex) {
            // Ok
        }
    }
View Full Code Here

            if (percolate.matches().size() != QUERIES) {
                System.err.println("No matching number of queries");
            }
            if ((i % 10000) == 0) {
                System.out.println("Percolated " + i + " took " + stopWatch.stop().lastTaskTime());
                stopWatch.start();
            }
        }
        System.out.println("Percolation took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac()));

        client.close();
View Full Code Here

        ESLogger logger = Loggers.getLogger(Node.class, settings.get("name"));
        logger.info("{{}}[{}]: closing ...", Version.full(), JvmInfo.jvmInfo().pid());

        StopWatch stopWatch = new StopWatch("node_close");
        stopWatch.start("http");
        if (settings.getAsBoolean("http.enabled", true)) {
            injector.getInstance(HttpServer.class).close();
        }
        stopWatch.stop().start("client");
        injector.getInstance(Client.class).close();
View Full Code Here

        barrier1 = new CyclicBarrier(numberOfReaders + numberOfWriters + 1);
        barrier2 = new CyclicBarrier(numberOfReaders + numberOfWriters + 1);

        // now, warm up a bit
        StopWatch stopWatch = new StopWatch("warmup");
        stopWatch.start();
        int warmupSize = 1000000;
        for (int i = 0; i < warmupSize; i++) {
            versionedMap.putVersion(i, i);
            versionedMap.beforeVersion(i, i);
        }
View Full Code Here

            t.start();
        }
        barrier1.await();

        StopWatch stopWatch = new StopWatch();
        stopWatch.start();
        barrier2.await();

        latch.await();
        stopWatch.stop();
View Full Code Here

            }));
        }
        barrier1.await();

        StopWatch stopWatch = new StopWatch("Acquirable");
        stopWatch.start();

        barrier2.await();

        for (Future f : results) {
            f.get();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.