Package org.modeshape.common.statistic

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


        String nodeType = "nt:folder";

        session.getRootNode().addNode("testRoot", nodeType);
        session.save();
        Stopwatch sw = new Stopwatch();
        sw.start();
        int totalNumberOfNodes = createSubgraphDepthFirst(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


            numberOfChildrenPerNode = totalNumberOfNodes;
        }

        List<String> childPaths = new ArrayList<String>();
        Stopwatch sw = new Stopwatch();
        sw.start();

        Node parentNode = session.getNode(parentAbsPath);
        for (int i = 0; i != numberOfChildrenPerNode; ++i) {
            Node child = parentNode.addNode(useSns ? "childNode" : ("childNode" + i), nodeType);
            for (int j = 0; j != numberOfPropertiesPerNode; ++j) {
View Full Code Here

            numberOfChildrenPerNode = totalNumberOfNodes;
        }

        String firstChildPath;
        Stopwatch sw = new Stopwatch();
        sw.start();
        int level = 1;
        do {
            sw.reset();
            sw.start();
            firstChildPath = null;
View Full Code Here

        Stopwatch sw = new Stopwatch();
        sw.start();
        int level = 1;
        do {
            sw.reset();
            sw.start();
            firstChildPath = null;
            Node parentNode = session.getNode(parentAbsPath);

            for (int i = 0; i != numberOfChildrenPerNode; ++i) {
                Node child = parentNode.addNode(useSns ? "childNode" : ("childNode" + i), nodeType);
View Full Code Here

        session.save();

        Stopwatch sw = new Stopwatch();
        Stopwatch total = new Stopwatch();
        try {
            total.start();
            for (int i = 0; i != 50; ++i) {
                System.out.print(".");
                int count = 100;
                sw.start();
                for (int j = 0; j != count; ++j) {
View Full Code Here

            InputStream input = Channels.newInputStream(originalChannel);
            if (useBufferedStream) input = new BufferedInputStream(input, bufferSize);

            // Copy the content ...
            Stopwatch sw = new Stopwatch();
            sw.start();
            IoUtil.write(input, output, bufferSize);
            sw.stop();
            System.out.println("Time to copy \"" + sourceFile.getName() + "\" (" + sourceFile.length() + " bytes): "
                               + sw.getTotalDuration());
        } finally {
View Full Code Here

        String content = CONTENT[contentIndex];
        String sha1 = CONTENT_HASHES[contentIndex];
        InputStream stream = new ByteArrayInputStream(content.getBytes());

        Stopwatch sw = new Stopwatch();
        sw.start();
        Binary binary = store.storeValue(stream, false);
        sw.stop();
        if (print) System.out.println("Time to store 18MB file: " + sw.getTotalDuration());

        if (valueClass != null) {
View Full Code Here

                                          long numBytes ) throws Exception {
        InputStream content = getClass().getClassLoader().getResourceAsStream(resourcePath);
        assertThat(content, is(notNullValue()));

        Stopwatch sw = new Stopwatch();
        sw.start();
        Binary binary = store.storeValue(content, false);
        sw.stop();
        if (print) System.out.println("Time to store " + desc + ": " + sw.getTotalDuration());

        if (numBytes == 0) {
View Full Code Here

        }

        if (print) {
            // And try measuring how fast we can read the file ...
            sw = new Stopwatch();
            sw.start();
            while (-1 != actual.read(buffer2)) {
            }
            sw.stop();
            System.out.println("Time to read " + desc + ": " + sw.getTotalDuration());
        }
View Full Code Here

        for (int i = 0; i != 10; ++i) {
            name = nameFactory.create("dna:something");
        }
        Stopwatch sw = new Stopwatch();
        int count = 20000000;
        sw.start();
        for (int i = 0; i != count; ++i) {
            name = nameFactory.create("dna:something");
        }
        sw.stop();
        System.out.println("Total duration for " + count + " calls: " + sw.getTotalDuration());
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.