Package org.modeshape.common.statistic

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


                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 ...
                nodeB = check(session1).mutableNode("/childB");
            }
        }
        total.stop();
View Full Code Here


                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");
            }
        }
        total.stop();
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());
    }

    @Test
View Full Code Here

        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

                    Problems backupProblems = session().getWorkspace().getRepositoryManager().backupRepository(testDirectory);
                    problems.set(backupProblems);
                } catch (RepositoryException e) {
                    throw new RuntimeException(e);
                }
                sw.stop();
                latch.countDown();
            }
        }).start();
        createSubgraph(session, "/extras", 1, 2, 2, false, new Stopwatch(), print ? System.out : null, null);
        latch.await(10, TimeUnit.SECONDS);
View Full Code Here

            for (int j = 0; j != count; ++j) {
                node.addNode("childNode" + j);
            }

            session.save();
            if (i > 2) sw.stop();

            // Now add another node ...
            node.addNode("oneMore");
            session.save();
View Full Code Here

                public boolean execute( String key,
                                        EditableDocument document ) {
                    return this.optimizer.optimizeChildrenBlocks(new NodeKey(key), document, targetCountPerBlock, tolerance);
                }
            });
            sw.stop();
            logger.info(JcrI18n.completeChildrenOptimization, getName(), sw.getTotalDuration().toSimpleString(), results);
            return results;
        } catch (Throwable e) {
            logger.info(JcrI18n.errorDuringChildrenOptimization, getName(), sw.getTotalDuration().toSimpleString(), e);
        }
View Full Code Here

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

            // Now add another node ...
            node.addNode("oneMore");
            session.save();
View Full Code Here

            if (i > 1) sw.start();
            for (int j = 0; j != count; ++j) {
                node.addNode("childNode" + j);
            }
            session.save();
            if (i > 1) sw.stop();

            // Now add another node ...
            node.addNode("oneMore");
            session.save();
View Full Code Here

        int numNodesEach = 0;
        for (int i = 0; i != samples; ++i) {
            System.out.print(".");
            sw.start();
            numNodesEach = createSubgraph(session, node, depth, numberOfChildrenPerNode, numberOfPropertiesPerNode, useSns, 1);
            sw.stop();
            session.save();
        }

        // session.getRootNode().getNode("testArea").remove();
        // session.save();
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.