Package org.modeshape.common.statistic

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


            }
            numberCreated++;
            childPaths.add(child.getPath());
        }
        session.save();
        sw.stop();
        System.out.println("Time to insert " + numberCreated + " nodes on level " + level + ": " + sw.getSimpleStatistics());

        if (numberCreated == totalNumberOfNodes) {
            return numberCreated;
        }
View Full Code Here


                if (firstChildPath == null) {
                    firstChildPath = child.getPath();
                }
            }
            session.save();
            sw.stop();
            System.out.println("Time to insert " + numberOfChildrenPerNode + " nodes on level " + level++ + ": "
                               + sw.getSimpleStatistics());
            totalNumberOfNodes -= numberOfChildrenPerNode;
            parentAbsPath = firstChildPath;
View Full Code Here

                    node.addNode("childNode" + j);
                }
                session.save();
                sw.stop();
            }
            total.stop();
        } finally {
            System.out.println();
            System.out.println(total.getDetailedStatistics());
            System.out.println(sw.getDetailedStatistics());
        }
View Full Code Here

            // 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 {
            tempFile.delete();
            if (destinationRaf != null) destinationRaf.close();
View Full Code Here

        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) {
            assertThat(binary, is(instanceOf(valueClass)));
        }
View Full Code Here

        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) {
            assertThat(binary, is(instanceOf(EmptyBinaryValue.class)));
        } else if (numBytes < MIN_BINARY_SIZE) {
View Full Code Here

            // 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());
        }
    }

    protected int countStoredFiles() throws IOException {
View Full Code Here

        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

            ringBuffer.add(value++);
            if (slightPauseBetweenEvents) {
                Thread.sleep(RANDOM.nextInt(50));
            }
        }
        sw.stop();

        // Do 10 more while printing ...
        for (int i = 0; i != 10; ++i) {
            // print = true;
            print("Adding entry " + value);
View Full Code Here

        }

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

        // Find node B again after the save ...
        nodeB = check(session1).mutableNode("/childB");
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.