Package org.modeshape.common.statistic

Examples of org.modeshape.common.statistic.Stopwatch.start()


        boolean slightPauseBetweenEvents = false;

        // Add 400K more entries
        Stopwatch sw = new Stopwatch();
        int count = 2000;
        sw.start();
        for (int i = 0; i != count; ++i) {
            ringBuffer.add(value++);
            if (slightPauseBetweenEvents) {
                Thread.sleep(RANDOM.nextInt(50));
            }
View Full Code Here


        final Stopwatch sw = new Stopwatch();
        Thread status = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("Starting ...");
                sw.start();
                int counter = 0;
                while (!stop.get()) {
                    try {
                        Thread.sleep(MILLISECONDS.convert(10, SECONDS));
                        if (!stop.get()) {
View Full Code Here

            nodeB.createChild(session(), newKey, name("newChild"), property("p1a", 344), property("p2", false));
            create.stop();
        }

        // And save ...
        save.start();
        session1.save();
        save.stop();
        total.stop();

        // Find node B again after the save ...
View Full Code Here

                session1.save();
                save.stop();
                print(false);
                print("Optimizing...");
                print(false);
                opt.start();
                txnManager().begin();
                optimizer.optimizeChildrenBlocks(key, null, 1000, 500); // will split into blocks ...
                txnManager().commit();
                opt.stop();
                // Find node B again after the save ...
View Full Code Here

                session1.save();
                save.stop();
                print(false);
                print("Optimizing...");
                print(false);
                opt.start();
                optimizer.optimizeChildrenBlocks(key, null, 1000, 500); // will split into blocks ...
                opt.stop();
                // Find node B again after the save ...
                nodeB = check(session1).mutableNode("/childB");
            }
View Full Code Here

    }

    @Test
    public void shouldPerformOneBackup() throws Exception {
        Stopwatch sw = new Stopwatch();
        sw.start();
        Problems problems = session().getWorkspace().getRepositoryManager().backupRepository(testDirectory);
        sw.stop();
        assertThat(problems.hasProblems(), is(false));
        System.out.println("Time to perform backup: " + sw.getMaximumDuration());
    }
View Full Code Here

    @Test
    public void shouldPerformMultipleBackups() throws Exception {
        for (int i = 0; i != 3; ++i) {
            File file = new File(testDirectory, "test" + i);
            Stopwatch sw = new Stopwatch();
            sw.start();
            Problems problems = session().getWorkspace().getRepositoryManager().backupRepository(file);
            sw.stop();
            assertThat(problems.hasProblems(), is(false));
            System.out.println("Time to perform backup: " + sw.getMaximumDuration());
        }
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);
        final AtomicReference<Problems> problems = new AtomicReference<Problems>();
        new Thread(new Runnable() {
            @Override
            public void run() {
                sw.start();
                try {
                    Problems backupProblems = session().getWorkspace().getRepositoryManager().backupRepository(testDirectory);
                    problems.set(backupProblems);
                } catch (RepositoryException e) {
                    throw new RuntimeException(e);
View Full Code Here

            // Each iteration adds another node under the root and creates the many nodes under that node ...
            Node node = session.getRootNode().addNode("testNode");
            session.save();

            int count = 100;
            if (i > 2) sw.start();
            for (int j = 0; j != count; ++j) {
                node.addNode("childNode" + j);
            }

            session.save();
View Full Code Here

     */
    public DocumentOperationResults optimizeChildren( final int targetCountPerBlock,
                                                      final int tolerance ) {
        Stopwatch sw = new Stopwatch();
        logger.info(JcrI18n.beginChildrenOptimization, getName());
        sw.start();

        try {
            DocumentOperationResults results = documentStore().localStore().performOnEachDocument(new DocumentOperation() {
                private static final long serialVersionUID = 1L;

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.