Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with Plugins--转载
原文地址:http://www.tomcatexpert.com/blog/2012/12/05/use-spring-insight-developer-analyze-code-install-it-tomcat-and-extend-it-plugins
People are still discovering the benefits of the free tool from VMware SpringSource, called Spring Insight Developer. This post provides an explanation of what Spring Insight Developer does, how to set it up with Apache Tomcat, and an example 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 an extremely useful, time-saving, free tool for Spring developers and also has plugins for Grails, GemFire, Hadoop, Hibernate, JMS, JNDI, LDAP, MongoDB, RabbitMQ, Redis, Spring Batch, Spring Integration, Tomcat, and many more on Github. In the latest release of Spring Insight, VMware introduced a new "split-agent" architecture that will enable this tool to be extended to more runtime languages besides Java, such as .NET, Ruby, PHP, Python, etc. There is also a bounty program where you can get paid to develop new plugin or offer to pay others.
What does Spring Insight Do?
In a nutshell, Spring Insight Developer lets you see what your code is doing. When, as a developer, you press a button in your application’s GUI, you can see what Java code is invoked, how it translates 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 do not have 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 you might expect, it also helps reduce project risk, makes applications more reliable, helps avoid releasing problem code into production, and makes troubleshooting production problems much easier.
- It works with Spring Insight Operations (read about the differences here) and vFabric Application Performance Manager within the vFabric Suite so that you can get the same view of code in a test, production, or other “live” system. For DevOps, this means we are all looking at the same information about application performance and problematic code.
- There are other benefits, like a plug-in based architecture, and you can read more about the approach to the “split-agent” 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 are two 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 of one or more operations starting with Endpoints (e.g. a GET service or other receptor of requests) but can also be 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 is captured in the history above along with the operations details.

Step 2: View the Trace Details
In the screen shot below, we see the last Trace in the history (top right) highlighted in dark green. For any user request, Spring Insight shows each Trace organized by Endpoint within an Application. Below the Trace History, 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 servlet 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 return 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 into 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 two forms, to understand the differences, see the post on Understanding the Difference between Spring Insight Developer & Spring Insight Operations. Neither option will provide an easy mechanism for installing Insight with Tomcat, but the set-up is 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
conf/server.xmland add the following Valve to the Engine block. <Valve className="com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve"/>- Edit
conf/context.xmland 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" />
- Edit
- 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 is 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 application'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 tc Server or with STS.
Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with Plugins--转载的更多相关文章
- IntelliJ IDEA启动spring boot项目出现Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[]]
IntelliJ IDEA启动spring boot项目出现Failed to start component [StandardEngine[Tomcat].StandardHost[localho ...
- Spring Boot源码(三):去除Tomcat
Spring boot中使用的是内置的Tomcat,而不像Spring mvc那样依赖外部tomcat运行项目. spring boot中导入了Tomcat的jar包: 点进一个Spring boot ...
- 【Azure Developer】VS Code运行Java 版Azure Storage SDK操作Blob (新建Container, 上传Blob文件,下载及清理)
问题描述 是否可以用Java代码来管理Azure blob? 可以.在代码中加入azure-storage-blob依赖.即可使用以下类操作Azure Storage Blob. BlobServic ...
- Spring中AOP的两种代理方式(Java动态代理和CGLIB代理-转载
内容是摘抄的,不知最初的原作者,见谅 Java 动态代理.具体有如下四步骤: 通过实现 InvocationHandler 接口创建自己的调用处理器: 通过为 Proxy 类指定 ClassLoade ...
- Code Review 程序员的寄望与哀伤【转载】
一个程序员,他写完了代码,在测试环境通过了测试,然后他把它发布到了线上生产环境,但很快就发现在生产环境上出了问题,有潜在的 bug. 事后分析,是生产环境的一些微妙差异,使得这种 bug 场景在线下测 ...
- LR接口性能测试提示Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post_message / two_ (转载)
一.在做JAVA接口性能测试时,场景在运行中出现:Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post ...
- Install Tomcat 6 on CentOS or RHEL --转载
source:http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos This post will cover installa ...
- Spring Boot Jar包转War包 部署到Tomcat下
原文:https://my.oschina.net/sdlvzg/blog/1562998 我们都知道springBoot中已经内置了tomcat,是不需要我们额外的配置tomcat服务器的,但是有时 ...
- 关于No Spring WebApplicationInitializer types detected on classpath的提示,tomcat 卡主
No Spring WebApplicationInitializer types detected on classpath 下一句:Initializing Spring root WebAppl ...
随机推荐
- URAL-1989 Subpalindromes 多项式Hash+树状数组
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1989 题意:给出一个字符串,m个操作:1,修改其中一个字符串,2,询问 [a, b] 是 ...
- hdu4135-Co-prime & Codeforces 547C Mike and Foam (容斥原理)
hdu4135 求[L,R]范围内与N互质的数的个数. 分别求[1,L]和[1,R]和n互质的个数,求差. 利用容斥原理求解. 二进制枚举每一种质数的组合,奇加偶减. #include <bit ...
- 第三百五十九天 how can I 坚持
在家待了一天,鼓捣了下linux,总算能连上网了,懂得还是少啊. 晚上去华北电力大学跑了会步,十圈,还挺有成就感呢,就是没带手环,哎. 以后学习一定要记笔记,上了这么多年学,都 没学会怎么记笔记,也是 ...
- TBluetoothLE
delphi 蓝牙技术 D:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\Multi-Device Sam ...
- C++11初始化列表
[C++11之初始化列表] 在C++03中,在严格遵守POD的定义和限制条件的结构及类型上可以使用初始化列表(initializer list),构想是结构或是数组能够依据成员在该结构内定义的顺序通过 ...
- hdu 5491 The Next (位运算)
http://acm.hdu.edu.cn/showproblem.php?pid=5491 题目大意:给定一个数D,它的二进制数中1的个数为L,求比D大的数的最小值x且x的二进制数中1的个数num满 ...
- Python序列(Sequence)
Sequence是Python的一种内置类型(built-in type),内置类型就是构建在Python Interpreter里面的类型,三种基本的Sequence Type是list(表),tu ...
- 根据路径获得文件名以及Aspose.Cells.dll操作excel 以及使用iTextSharp.text.pdf.PdfReader.dll对PDF的操作
string result = Regex.Match(str,@"[^\\]+$").Value;//正则表达式 this.listBox1.Items.Add(Path.Get ...
- Android PHP 通过JSON进行数据交互
一.首先是Android客户端解析PHP返回的JSON数据 1.PHP代码(这里用到了数据库,如果没有准备数据库的话,可以自定义字符串) <?php $link=mysql_connect(SA ...
- Lucene/ElasticSearch 学习系列 (2) Information Retrival 初步之名词解释
计算机领域一半是理论,一半是在理论基础之上的应用.要想深入地掌握某个方面的应用,就需要先学习那方面的理论. “搜索”是应用,其背后的理论是 "Information Retrieval&qu ...