Package org.modeshape.common.statistic

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


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

            if (i > 2) {
                sw.start();
            }
            for (int j = 0; j != MANY_NODES_COUNT; ++j) {
                node.addNode("childNode");
            }
            session.save();
View Full Code Here


            Node node = session.getRootNode().addNode("testNode");
            session.save();

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

            System.out.print("Iterating ");
        }
        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();
        }
View Full Code Here

        // Now try getting a node at one level down ...
        String name = "childNode";
        int index = numberOfChildrenPerNode / 2;
        String path = useSns ? (name + "[" + index + "]") : (name + index);
        sw.reset();
        sw.start();
        Node randomNode = node.getNode(path);
        sw.stop();
        assertThat(randomNode, is(notNullValue()));
        if (print) {
            System.out.println("Find " + randomNode.getPath() + ": " + sw.getTotalDuration());
View Full Code Here

        // create a parent with a number of nodes initially
        Node parent = session.getRootNode().addNode("testRoot");
        session.save();

        Stopwatch globalSw = new Stopwatch();
        globalSw.start();
        if (print) {
            System.out.println("Starting to insert batches...");
        }
        for (int i = 0; i < insertBatches; i++) {
            // reload the parent in the session after it was saved
View Full Code Here

        globalSw.stop();
        if (print) {
            System.out.println("Inserted " + initialNodeCount + " nodes in: " + globalSw.getSimpleStatistics());
        }
        globalSw.reset();
        globalSw.start();
        Stopwatch readSW = new Stopwatch();
        // add additional batches of nodes while reading the paths after each batch of children was added
        int batchCount = 36;
        int batchSize = 1000;
        for (int i = 0; i < batchCount; i++) {
View Full Code Here

        int batchSize = 1000;
        for (int i = 0; i < batchCount; i++) {
            // creates batchSize
            long childCountAtBatchStart = session.getNode("/testRoot").getNodes().getSize();
            int newChildrenCount = createSubgraph(session, parent, 1, batchSize, propertiesPerChild, true, 1);
            readSW.start();

            // load each of the newly added children into the session and get their paths
            final long newChildCount = childCountAtBatchStart + newChildrenCount;

            for (long j = childCountAtBatchStart; j < newChildCount; j++) {
View Full Code Here

        String nodeType = "nt:unstructured";

        session.getRootNode().addNode("testRoot", nodeType);
        session.save();
        Stopwatch sw = new Stopwatch();
        sw.start();
        int totalNumberOfNodes = createSubgraphBreadthFirst(1, nodeType, "/testRoot", totalNodeCount, childrenPerNode,
                                                            propertiesPerNode, true);
        sw.stop();
        System.out.println("Total time to insert " + totalNumberOfNodes + " nodes in batches of " + childrenPerNode + ": "
                           + sw.getSimpleStatistics());
View Full Code Here

        String nodeType = "nt:folder";

        session.getRootNode().addNode("testRoot", nodeType);
        session.save();
        Stopwatch sw = new Stopwatch();
        sw.start();
        int totalNumberOfNodes = createSubgraphBreadthFirst(1, nodeType, "/testRoot", totalNodeCount, childrenPerNode,
                                                            propertiesPerNode, false);
        sw.stop();
        System.out.println("Total time to insert " + totalNumberOfNodes + " nodes in batches of " + childrenPerNode + ": "
                           + sw.getSimpleStatistics());
View Full Code Here

        String nodeType = "nt:unstructured";

        session.getRootNode().addNode("testRoot", nodeType);
        session.save();
        Stopwatch sw = new Stopwatch();
        sw.start();
        int totalNumberOfNodes = createSubgraphDepthFirst(nodeType, "/testRoot", totalNodeCount, childrenPerNode,
                                                          propertiesPerNode, true);
        sw.stop();
        System.out.println("Total time to insert " + totalNumberOfNodes + " nodes in batches of " + childrenPerNode + ": "
                           + sw.getSimpleStatistics());
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.