Package org.springframework.util

Examples of org.springframework.util.StopWatch.start()


    @Test
    public void testConcurrentReadWrite10PercentUnstructured() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentReadWrite10PercentUnstructured");
        stopWatch.start(Thread.currentThread().getName() + " reading // writing nodes (10% writers)");
        for (int i = 0; i < 1000; i++) {
            if (i % 10 == 0) {
                service.submit(new Writer("nt:unstructured"), Boolean.TRUE);
            } else {
                service.submit(new Reader(), Boolean.TRUE);
View Full Code Here


    @Test
    public void testConcurrentSearchIsDescendant() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentSearchIsDescendant");
        stopWatch.start(Thread.currentThread().getName() + " search jnt:pages nodes is descendant site node");
        for (int i = 0; i < 1000; i++) {
            service.submit(new Search("select * from [jnt:page] as page where isdescendantnode(page, 'path') "), Boolean.TRUE);
        }
        for (int i = 0; i < 1000; i++) {
            Boolean aBoolean = service.take().get();
View Full Code Here

    @Test
    public void testConcurrentSearchIsChild() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentSearchIsChild");
        stopWatch.start(Thread.currentThread().getName() + " search jnt:pages nodes is child site node");
        for (int i = 0; i < 1000; i++) {
            service.submit(new Search("select * from [jnt:page] as page where ischildnode(page, 'path') "), Boolean.TRUE);
        }
        for (int i = 0; i < 1000; i++) {
            Boolean aBoolean = service.take().get();
View Full Code Here

    @Test
    public void testConcurrentSearchIsDescendantAndIteratorResults() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentSearchIsDescendantAndIteratorResults");
        stopWatch.start(Thread.currentThread().getName() + " search jnt:page nodes is descendant site node, iterator results for query results size = -1 ");
        for (int i = 0; i < 1000; i++) {
            service.submit(new SearchIteratorResults("select * from [jnt:page] as page where isdescendantnode(page, 'path') "), Boolean.TRUE);
        }
        for (int i = 0; i < 1000; i++) {
            Boolean aBoolean = service.take().get();
View Full Code Here

    @Test
    public void testConcurrentSearchIsCreatedBeforeNow() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentSearchIsCreatedBeforeNow");
        stopWatch.start(Thread.currentThread().getName() + " search jnt:page nodes is created before now");
        for (int i = 0; i < 1000; i++) {
            service.submit(new Search("select * from [jnt:page] as page where page.[jcr:created] < CAST(" + System.currentTimeMillis() + " as date) "), Boolean.TRUE);
        }
        for (int i = 0; i < 1000; i++) {
            Boolean aBoolean = service.take().get();
View Full Code Here

    @Test
    public void testConcurrentSearchIsCreatedBeforeNowAndIsDescendant() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentSearchIsCreatedBeforeNowAndIsDescendant");
        stopWatch.start(Thread.currentThread().getName() + " search jnt:page nodes is created before now and is descendant site node");
        for (int i = 0; i < 1000; i++) {
            service.submit(new Search("select * from [jnt:page] as page where isdescendantnode(page, 'path') and page.[jcr:created] < CAST(" + System.currentTimeMillis() + " as date) "), Boolean.TRUE);
        }
        for (int i = 0; i < 1000; i++) {
            Boolean aBoolean = service.take().get();
View Full Code Here

            context.setSite(homeNode.getResolveSite());
            new URLGenerator(context, resource);

            SearchCriteria criteria = createSearchCriteria();
            StopWatch stopWatch = new StopWatch("search");
            stopWatch.start("Starting 1000 searchs");
            for (int j = 0; j < 1000; j++) {
                List<Hit<?>> hits = searchService.search(criteria, context).getResults();
                int i = 0;
                for (Hit<?> hit : hits) {
                    logger.info("[" + j + "][" + (++i) + "]: " + hit.getLink());
View Full Code Here

    }

    @Test
    public void testDumper() throws IOException {
        StopWatch stopWatch = new StopWatch("testErrorFileDumper");
        stopWatch.start(Thread.currentThread().getName() + " generating error dumps");
        for (int i=0; i < LOOP_COUNT; i++) {
            MockHttpServletRequest request = new MockHttpServletRequest();
            request.setRequestURI("/cms");
            request.setQueryString("name=value");
            request.addHeader("headerName", "headerValue");
View Full Code Here

        long prima = 0;
        long dopo = 0;
        StopWatch sw = new StopWatch();
        prima = System.currentTimeMillis();
        System.out.println("prima" + prima);
        sw.start(invocation.getMethod().getName());

        Object returnValue = invocation.proceed();

        sw.stop();
        dopo = System.currentTimeMillis();
View Full Code Here

        }
    }

    void reloadRootModule() {
        StopWatch watch = new StopWatch();
        watch.start();
        Impala.reloadRootModule();
        watch.stop();
        String rootName = Impala.getRootModuleDefinition().getName();
        InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
    }
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.