Solved

Identify processing time at each layer

Posted on 2014-09-03
7
197 Views
Last Modified: 2014-09-12
Hi,

I have created a sample web application in which there is a servlet.logic and dao layer.
I want to check how much time is taken at each layer while processing the request.,

Web application server is tomcat.

Is there any tool which can be configured in tomcat to achieve the above requirement?
0
Comment
Question by:Rocking
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 40302767
You can do it bu using System.currentTimeMillis().

Put a long start = System.currentTimeMillis(); before entering the layer. Then put a long finish = System.currentTimeMillis(); when exiting the layer. Then simply subtract start from finish.
0
 

Author Comment

by:Rocking
ID: 40305007
suppose there are 10,000 files and if we start doing like this it is time consuming.
What i need a open source too,or configuration which can meet the requirement.
0
 
LVL 35

Expert Comment

by:girionis
ID: 40305344
It's not easy to distinguish between software levels, so I don't think there is an automated tool to do this. But some other expert might have moire knowledge on this matter.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 12

Expert Comment

by:Sharon Seth
ID: 40309261
I believe JAMon should actually provide what you are looking for , not out of the box  but with some customization.
0
 

Author Comment

by:Rocking
ID: 40310622
Jamon is a text template engine for Java, useful for generating dynamic HTML, XML, or any text-based content. In a typical Model-View-Controller architecture, Jamon clearly is aimed at the View (or presentation) layer.

how can it achieve in Identify processing time at each layer?
0
 
LVL 27

Accepted Solution

by:
dpearson earned 500 total points
ID: 40311351
I think you can do this using a regular profiler - assuming your classes are sensibly named.

Start with a profiler (I like visualvm - http://visualvm.java.net/).
This allows you to see the overall performance of your application and where it's spending the most time.
Run your app and collect this overall data first.  (You don't need to modify tomcat for this sort of profiler - you just start it up and point visualvm at it).

However, it you want to specifically break the profiling into layers, you could do that by setting the "profiling roots" (see this article: https://blogs.oracle.com/nbprofiler/entry/profiling_with_visualvm_part_2) to the classes in your DAO layer (this is assuming the class name allows you to identify which layer it's in).

Run your app, collect this profile data.

Now if you subtract the time spent in the overall profile from the time spent in the DAO layer you have the time spent in the layer above the DAO.  If it's just 2 tier you're done.  But if you have a 3rd tier, you can then set your roots to your servlet classes and repeat the process.  Again, the different between the profiling data gives you the time spent in the layer.

It's not trivial, but you should be able to get everything you need in an afternoon.

Hope that helps,

Doug
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question