Package org.springframework.util

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


  public void listImages(int nrOfCalls) throws IOException {
    List images = this.imageDatabase.getImages();
    StopWatch stopWatch = new StopWatch();
    for (Iterator it = images.iterator(); it.hasNext();) {
      ImageDescriptor image = (ImageDescriptor) it.next();
      stopWatch.start(image.getName());
      ByteArrayOutputStream os = null;
      for (int i = 0; i < nrOfCalls; i++) {
        os = new ByteArrayOutputStream();
        this.imageDatabase.streamImage(image.getName(), os);
      }
View Full Code Here


    Map orderServices = this.beanFactory.getBeansOfType(JaxRpcWorkflowStarter.class);
    for (Iterator it = orderServices.keySet().iterator(); it.hasNext();) {
      String beanName = (String) it.next();
      JaxRpcWorkflowStarter orderService = (JaxRpcWorkflowStarter) orderServices.get(beanName);
      System.out.println("Calling OrderService '" + beanName + "' with order ID " + orderId);
      stopWatch.start(beanName);
      String order = null;
      for (int i = 0; i < nrOfCalls; i++) {
        //order = orderService.startWorkflow();
      }
      stopWatch.stop();
View Full Code Here

        try {
            JahiaSite site = TestHelper.createSite(TESTSITE_NAME);
            JCRTemplate.getInstance().doExecuteWithSystemSession(new JCRCallback<Object>() {
                public Object doInJCR(JCRSessionWrapper session) throws RepositoryException {
                    StopWatch stopWatch = new StopWatch("oneTimeSetUp");
                    stopWatch.start(Thread.currentThread().getName() + " creating set up nodes");
                    int pagesCreated = TestHelper.createSubPages(session.getNode(SITECONTENT_ROOT_NODE), 3, NB_CHILDREN);
                    logger.info("Created " + pagesCreated + " page hierarchy.");
                    session.save();
                    stopWatch.stop();
                    logger.error(stopWatch.prettyPrint());
View Full Code Here

    @Test
    public void testCreateManyChildUnstructuredNodes() throws RepositoryException {
        JCRTemplate.getInstance().doExecuteWithSystemSession(new JCRCallback<Object>() {
            public Object doInJCR(JCRSessionWrapper session) throws RepositoryException {
                StopWatch stopWatch = new StopWatch("testCreateManyChildUnstructuredNodes");
                stopWatch.start(Thread.currentThread().getName() + " creating unstructured nodes");
                JCRNodeWrapper currentNode = session.getNode(SITECONTENT_ROOT_NODE);
                Node node = currentNode.addNode("testnodeUnstructured", "nt:unstructured");
                for (int i = 0; i < CHILD_COUNT; i++) {
                    node.addNode("node" + i, "nt:unstructured");
                }
View Full Code Here

    @Test
    public void testCreateManyChildPageNodes() throws RepositoryException {
        JCRTemplate.getInstance().doExecuteWithSystemSession(new JCRCallback<Object>() {
            public Object doInJCR(JCRSessionWrapper session) throws RepositoryException {
                StopWatch stopWatch = new StopWatch("testCreateManyChildPageNodes");
                stopWatch.start(Thread.currentThread().getName() + " creating page nodes");
                JCRNodeWrapper currentNode = session.getNode(SITECONTENT_ROOT_NODE);
                Node node = currentNode.addNode("testPageNode", "jnt:page");
                for (int i = 0; i < CHILD_COUNT; i++) {
                    node.addNode("child" + Integer.toString(i), "jnt:page");
                }
View Full Code Here

    @Test
    public void testConcurrentRead() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentRead");
        stopWatch.start(Thread.currentThread().getName() + " only reading nodes");
        for (int i = 0; i < 1000; i++) {
            service.submit(new Reader(), Boolean.TRUE);
        }
        for (int i = 0; i < 1000; i++) {
            Boolean aBoolean = service.take().get();
View Full Code Here

    @Test
    public void testConcurrentReadWrite10Percent() throws InterruptedException, ExecutionException {
        ExecutorService executor = Executors.newFixedThreadPool(300);
        ExecutorCompletionService<Boolean> service = new ExecutorCompletionService<Boolean>(executor);
        StopWatch stopWatch = new StopWatch("testConcurrentReadWrite10Percent");
        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("jnt:page"), Boolean.TRUE);
            } else {
                service.submit(new Reader(), Boolean.TRUE);
View Full Code Here

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

        Logger profilerMetricsLogger = Logger.getLogger("profilerLoggingService");
        profilerMetricsLogger.setLevel(Level.OFF);
       
        metricsLogger.setLevel(Level.OFF);
        StopWatch stopWatch = new StopWatch();
        stopWatch.start("Create " + TAGS_TO_CREATE + " without logs");
        for (int i = 0; i < TAGS_TO_CREATE; i++) {
            service.createTag(generateTagName(), TESTSITE_NAME);
        }
        stopWatch.stop();
        final long withoutLogs = stopWatch.getLastTaskTimeMillis();
View Full Code Here

        for (int i = 0; i < 3; i++) {
            service.createTag(generateTagName(), TESTSITE_NAME);
        }
       
        metricsLogger.setLevel(Level.TRACE);
        stopWatch.start("Create " + TAGS_TO_CREATE + " with logs");
        for (int i = 0; i < TAGS_TO_CREATE; i++) {
            service.createTag(generateTagName(), TESTSITE_NAME);
        }
        stopWatch.stop();
        final long withLogs = stopWatch.getLastTaskTimeMillis();
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.