Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with plugins--reprint

Source: Internet
Author: User
Tags rabbitmq apache tomcat

Original address: http://www.tomcatexpert.com/blog/2012/12/05/ Use-spring-insight-developer-analyze-code-install-it-tomcat-and-extend-it-plugins

People is still discovering the benefits of the free tool from VMware SpringSource, called Spring Insight Developer. This post provides a explanation of what Spring Insight Developer does, how to set it up with Apache Tomcat, and an E  Xample of available plugins. For a better visual, there is also a video of the new Spring Insight 1.8.3 GUI embedded below.

Spring Insight is a extremely useful, time-saving, free tool for Spring developers and also have plugins for Grails, Gemfi Re, Hadoop, Hibernate, JMS, JNDI, LDAP, MongoDB, RabbitMQ, Redis, Spring Batch, Spring integration, Tomcat, and many m  Ore on Github. In the latest release of Spring Insight, VMware introduced a new ' split-agent ' architecture that'll enable this tool to BES extended to more runtime languages besides Java, such as. NET, Ruby, PHP, Python, etc. There is also a bounty program where can get the paid to develop new plugin or offer to pay others.

What does Spring Insight does?

In a nutshell, Spring Insight Developer lets-what your code is doing. When, as a developer, you press a button in your application's GUI, can see what Java code is invoked, how it Translat Es into SQL, and quite a bit more. Before we show it in action, it's worth mentioning a few of the benefits.

  • As mentioned, it's free, and it's also quite easy to download, set-up, and understand.
  • Since Spring Insight uses AspectJ and AOP to Load-time weave your application, you don't have the to make any changes to your Application code to use Spring Insight.
  • It helps you code, test, troubleshoot, and iterate more quickly through development efforts.
  • As might expect, it also helps reduce project risk, makes applications more reliable, helps avoid releasing problem co De into production, and makes troubleshooting production problems much easier.
  • It works with Spring Insight Operations (read on the differences here) and vFabric application performance manager< c1> within the vFabric Suite so it can get the same view of code in a test, production, or other "live" system. For DevOps, this means we is all looking on the same information about application performance and problematic code.< /c3>
  • There is other benefits, like a plug-in based architecture, and you can read more about the approach to the "Split-ag ENT "architecture (i.e. how Spring Insight Operations works) in this article.

Let's take a look at a simple example of tracing your app, viewing the details, and seeing the code in action.

Step 1:trace Your App

In the screen shot below, there is windows.

    • The top window shows the "Recent Activity" tab within Spring Insight running on localhost. This tab shows the ' Trace history ' over time. A Trace represents a thread of execution. It is usually started by an HTTP request made up to one or more operations starting with endpoints (e.g. a GET service or Other receptor of requests) but can also is started by a background job.
    • The bottom window shows the VMware vFabric springtrader Reference Architecture application running and the button "Get Quote "being pressed. When you press the button, the Trace was captured in the history above along with the operations details.

Step 2:view the Trace Details

In the screens shot below, we see the last Trace in the "top right" highlighted in dark green.  For any user request, Spring Insight shows each Trace organized by Endpoint within an application. Below the Trace, we see the individual traces. We have the Quotecontroller#findquote Endpoint highlighted. It took 8ms for the GET/SPRING-NANOTRADER-SERVICES/API/QUOTE/VMW to run from the application spring-nanotrader-services. Below this, we see the trace details (including the breakdown of what took the most time in the 8ms trace):

    • Filters for servlets operations like security and authentication
    • The Quotecontroller#findquote request/response servlet operation
    • A JDBC SELECT (QUOTE) Database call

Step 3:seeing The Method call, Arguments Passed and returned

By expanding Quotecontroller#findquote, we can see the ' VMW ' argument passed in from the original GUI interaction, the RET Urn value, and the source code location. We could also see the SQL passed or similar details in a SQL transaction.  This let's you quickly drill down to problem areas that take too long.  Keep in mind, Spring Insight Operations Let's you do this in production systems too.

How to Install Spring Insight for Tomcat

Spring Insight comes in both forms, to understand the differences, see the post on understanding the difference between SPR ing Insight Developer & Spring Insight Operations. Neither option would provide an easy mechanism for installing Insight with Tomcat, but the set-up was not terribly difficult .

    • Download vFabric TC Server Developer
    • Create a vFabric TC Server instance which has Insight enabled.
    • Download the latest Apache Tomcat 6.0.x or 7.0.x
    • Copy the following files & folders from the TC Server instance W/insight
      • bin/setenv.sh
      • Bin/insight-bootstrap-tcserver-1.8.3.release.jar
      • Insight
      • lib/*
      • Webapps/insight.war
    • Edit and conf/server.xml Add the following Valve to the Engine block.
    • <Valve className="com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve"/&gt;
      • Edit and conf/context.xml Add the following before the closing Context tag.
      • <Loader loaderClass="com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader" />
      • <Listener className="com.springsource.insight.collection.tcserver.lifecycle.ApplicationLifecycleCollectionListener" />
    • Start the Tomcat instance.
Plug-in Architecture example:using Spring Insight with RabbitMQ

As mentioned above, there is a wealth of plugins available. In case you missed it, there are a post on the RabbitMQ Plugin for Spring Insight. This plugin allows for monitoring RabbitMQ Java client libraries at the Code-level and allows you to monitor your Applicat Ion ' s performance around publishing and receiving messages with RabbitMQ. There is a more detail and an example screenshot in this article.

The entire list of Spring Insight Plugins is available at Github
You can download Spring Insight on the TC Server or with STS.

Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with plugins--reprint

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.