About Michal Jastak

Michał is a Chief Technology Officer in Java Division of AIS.PL, company developing mostly Web Applications of different kind, usually e-Government related.

Spring Insight – Web Application Profiling

Are you writing Web Applications using Spring Framework? Have you ever thought what’s going on under the hood? Why your application is responding so slowly? Why the snail outside your window is disappearing in the distance so fast while you still wait for your application response? You should :) and the Spring Insight can be very helpful with this task.

You should start with the tc Server Developer Edition which is in fact the well known Apache Tomcat 6.0 on steroids ;). Then you should take a look at Spring Insight – this tool is installed into tc Server as a usual web application and allows you to take a journey into your own application ;)

I’ll put here only a few screenshots of Spring Insight into action, detailed information about installing and using tc Server along with the Spring Insight can be found on the Spring Source web pages.

Let’s start ;)

When you click one of the bars on the chart you will see the details of request handling:

As you see on the screen request handling took 316 ms. Trace Detail section holds all methods which were executed during the request handling and all database queries which were performed.

For each method/database call you can see the details like input parameters, SQL Query executed, or returned value (method only). Selecting request details will show you quick request summary along with request and response headers.

You may wonder why you see the database queries during the view rendering? As you know JPA’s lazy loading defers loading the entities from database until they are used for the first time, and it happens during the view rendering. As you see on the above example, there are potential places for improvements (consider dropping lazy usage, use batch reading instead of one by one while fetching lazy entities).

Spring Insight offers you also some statistics about the used application resources – see Browse Resources at the top of page.

Of course you can see the details for each resource:

Summarizing this cartoon post :) – very interesting tool for all of the Spring Framework addicted developers – but in fact not only them – some parts of Spring Insight should be functional also for ordinary Servlet, or application written using some other framework. There is also possibility of writing your own Spring Insight plugins, so don’t hesitate ;) use it and extend ;) – it is worth it.

Reference: Web Application Profiling – Spring Insight from our JCG partner Warlock at the “Warlock’s Thoughts” blog.

Related Articles :
Related Whitepaper:

Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions

Get ready to program in a whole new way!

Functional Programming in Java will help you quickly get on top of the new, essential Java 8 language features and the functional style that will change and improve your code. This short, targeted book will help you make the paradigm shift from the old imperative way to a less error-prone, more elegant, and concise coding style that’s also a breeze to parallelize. You’ll explore the syntax and semantics of lambda expressions, method and constructor references, and functional interfaces. You’ll design and write applications better using the new standards in Java 8 and the JDK.

Get it Now!  

Leave a Reply

5 − four =

Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

20,709 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books