Package org.jboss.dna.common.statistic

Examples of org.jboss.dna.common.statistic.Stopwatch.start()


        for (int i = 0; i != 3; ++i) {
            super.numberOfConnections = 0;
            Stopwatch sw = new Stopwatch();

            // Get the root ...
            sw.start();
            Node<JcrNodePayload, JcrPropertyPayload> root = cache.findNode(null, path("/"));
            root.getPath();
            root.getPayload(); // forces a load
            sw.stop();
View Full Code Here


        for (int i = 0; i != 3; ++i) {
            super.numberOfConnections = 0;
            Stopwatch sw = new Stopwatch();

            // Get the root ...
            sw.start();
            Node<JcrNodePayload, JcrPropertyPayload> root = cache.findNode(null, path("/"));
            root.getPath();
            root.getPayload(); // forces a load
            sw.stop();
View Full Code Here

        for (int i = 0; i != 3; ++i) {
            Stopwatch sw = new Stopwatch();
            super.numberOfConnections = 0;

            // Get the root ...
            sw.start();
            Node<JcrNodePayload, JcrPropertyPayload> root = cache.findNode(null, path("/"));
            root.getPath();
            root.getPayload(); // forces a load
            sw.stop();
View Full Code Here

                         Request request ) throws RepositorySourceException {
        Logger logger = context.getLogger(getClass());
        Stopwatch sw = null;
        if (logger.isTraceEnabled()) {
            sw = new Stopwatch();
            sw.start();
        }

        // Do any commands update/write?
        PathRequestProcessor processor = repository.createRequestProcessor(context, source);
        PathRepositoryTransaction txn = processor.getTransaction();
View Full Code Here

                         Request request ) throws RepositorySourceException {
        Logger logger = context.getLogger(getClass());
        Stopwatch sw = null;
        if (logger.isTraceEnabled()) {
            sw = new Stopwatch();
            sw.start();
        }
        // Do any commands update/write?
        RepositoryContext repositoryContext = this.source.getRepositoryContext();
        Observer observer = repositoryContext != null ? repositoryContext.getObserver() : null;
        RequestProcessor processor = new MapRequestProcessor(context, this.repository, observer, source.areUpdatesAllowed());
View Full Code Here

                         Request request ) throws RepositorySourceException {
        Logger logger = context.getLogger(getClass());
        Stopwatch sw = null;
        if (logger.isTraceEnabled()) {
            sw = new Stopwatch();
            sw.start();
        }
        // Do any commands update/write?
        RequestProcessor processor = new MapRequestProcessor(context, this.repository, this.source.getRepositoryContext());

        Lock lock = request.isReadOnly() ? repository.getLock().readLock() : repository.getLock().writeLock();
View Full Code Here

            // Perform second batch ...
            batch = graph.batch();
            totalNumberCreated += createChildren(batch, initialPath, "secondBranch", 2, numberOfPropertiesPerNode, 2, null);
            Stopwatch sw = new Stopwatch();
            sw.start();
            batch.execute();
            sw.stop();
            System.out.println("     final " + getTotalAndAverageDuration(sw, totalNumberCreated));
            assertThat(totalNumberCreated, is(totalNumber + calculateTotalNumberOfNodesInTree(2, 2, false)));
        }
View Full Code Here

                   "dnaxml:processingInstructionContent=" + data);
    }

    protected void parse( String relativePathToXmlFile ) throws IOException, SAXException {
        Stopwatch sw = new Stopwatch();
        sw.start();
        InputStream stream = getClass().getClassLoader().getResourceAsStream(relativePathToXmlFile);
        try {
            XMLReader reader = XMLReaderFactory.createXMLReader();
            reader.setContentHandler(handler);
            reader.setErrorHandler(handler);
View Full Code Here

        request.freeze();
        assertThat(request.hasIncompleteRequests(), is(true));
        CountDownLatch latch = request.getLatch();
        assertThat(latch.getCount(), is(3L));
        Stopwatch sw = new Stopwatch();
        sw.start();
        new Thread(new CountDownRunnable(latch, 100L)).start();
        request.await(); // this blocks until the latch reaches 0
        assertThat(latch.getCount(), is(0L));
        sw.stop();
        assertThat(sw.getTotalDuration().getDurationInMilliseconds().intValue() >= 250, is(true));
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.