Solved

Identify processing time at each layer

Posted on 2014-09-03
7
191 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
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
New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

 
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 26

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

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 98
.htaccess file settings 4 54
factorial example 4 34
servlet example issue 6 27
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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 …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

947 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now