Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Identify processing time at each layer

Posted on 2014-09-03
7
Medium Priority
?
204 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
6 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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
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 28

Accepted Solution

by:
dpearson earned 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

876 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