Apache Sirona Java应用监视器,能够实时获得每个http/JDBC响应时间
2016-10-21 12:20
246 查看
官方URL:http://sirona.incubator.apache.org/quick-start.html
How to enable Apache Sirona in your web application.
NOTE: this simple configuration save figures in memory (so no more after restart!!)
If you want to store datas, you must have a look at the Cassandra Storage.
<properties>
<sirona.version>0.2-incubating</sirona.version>
</properties>
<dependencies>
....
<!-- sirona dependencies -->
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-core</artifactId>
<version>${sirona.version}</version>
</dependency>
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-reporting</artifactId>
<version>${sirona.version}</version>
<classifier>classes</classifier>
</dependency>
...
</dependencies>
If you are using a servlet 3.0 container nothing to do as we use ServletContainerInitializer mechanism. Otherwise you need to configure the filter class org.apache.sirona.reporting.web.SironaController .
In web.xml
<!-- activated per default -->
<context-param>
<param-name>org.apache.sirona.reporting.activated</param-name>
<param-value>true</param-value>
</context-param>
<!-- path in the application default is /sirona -->
<context-param>
<param-name>org.apache.sirona.reporting.mapping</param-name>
<param-value>/monitoring</param-value>
</context-param>
Just start your application and now browse /sirona (or the path you configured) and have fun (or not).
NOTE: the configuration include only basic collectors. If you need more figures you need to add more dependencies
To collect various web informations as:
response time per http return code
hits, response time etc.. per http path
number of active sessions
etc.. see Web plugin.
Simply add the dependency:
<dependencies>
....
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-web</artifactId>
<version>${sirona.version}</version>
</dependency>
...
</dependencies>
To collect response time for jdbc queries.
Add the dependency:
<dependencies>
....
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-jdbc</artifactId>
<version>${sirona.version}</version>
</dependency>
...
</dependencies>
Configure the jdbc driver now
Normal configuration:
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:${appserver.base}/database/users;create=true"
Sirona configuration:
driverClassName="org.apache.sirona.jdbc.SironaDriver"
url="jdbc:sirona:derby:${appserver.base}/database/users;create=true?delegateDriver=org.apache.derby.jdbc.EmbeddedDriver"
Quick Start
How to enable Apache Sirona in your web application.NOTE: this simple configuration save figures in memory (so no more after restart!!)
If you want to store datas, you must have a look at the Cassandra Storage.
Declare version
<properties>
<sirona.version>0.2-incubating</sirona.version>
</properties>
<dependencies>
....
<!-- sirona dependencies -->
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-core</artifactId>
<version>${sirona.version}</version>
</dependency>
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-reporting</artifactId>
<version>${sirona.version}</version>
<classifier>classes</classifier>
</dependency>
...
</dependencies>
Configuration
If you are using a servlet 3.0 container nothing to do as we use ServletContainerInitializer mechanism. Otherwise you need to configure the filter class org.apache.sirona.reporting.web.SironaController .In web.xml
<!-- activated per default -->
<context-param>
<param-name>org.apache.sirona.reporting.activated</param-name>
<param-value>true</param-value>
</context-param>
<!-- path in the application default is /sirona -->
<context-param>
<param-name>org.apache.sirona.reporting.mapping</param-name>
<param-value>/monitoring</param-value>
</context-param>
Using
Just start your application and now browse /sirona (or the path you configured) and have fun (or not).NOTE: the configuration include only basic collectors. If you need more figures you need to add more dependencies
More figures
Web figures
To collect various web informations as:response time per http return code
hits, response time etc.. per http path
number of active sessions
etc.. see Web plugin.
Simply add the dependency:
<dependencies>
....
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-web</artifactId>
<version>${sirona.version}</version>
</dependency>
...
</dependencies>
JDBC
To collect response time for jdbc queries.Add the dependency:
<dependencies>
....
<dependency>
<groupId>org.apache.sirona</groupId>
<artifactId>sirona-jdbc</artifactId>
<version>${sirona.version}</version>
</dependency>
...
</dependencies>
Configure the jdbc driver now
Normal configuration:
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:${appserver.base}/database/users;create=true"
Sirona configuration:
driverClassName="org.apache.sirona.jdbc.SironaDriver"
url="jdbc:sirona:derby:${appserver.base}/database/users;create=true?delegateDriver=org.apache.derby.jdbc.EmbeddedDriver"
相关文章推荐
- Apache Logs: how long does it take to serve a request?(apache配置access.Log记录响应时间)http://www.ducea.com/2008/02/06/apache-logs-how-
- java 写的能够响应浏览器请求的 http 服务器
- java 使用拦截器统计每个http请求的响应时间
- JAVA发送HTTP请求(post、get),读取HTTP响应内容,实例及应用
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- 【原创】LoadRunner如何获得参数化中每个关键字的搜索响应时间
- LoadRunner如何获得参数化中每个关键字的搜索响应时间
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- 使用Filter统计Java(J2EE)的web程序http请求响应时间
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- JAVA发送HTTP请求,返回HTTP响应内容,应用及实例代码
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- LoadRunner如何获得参数化中每个关键字的搜索响应时间
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- JAVA发送HTTP请求,返回HTTP响应内容,实例及应用
- 使用Filter统计Java(J2EE)的web程序http请求响应时间
- LR获得参数化中每个关键字的搜索响应时间
- JAVA应用apache httpclient探测http服务
- 三个UNIX文件时间ctime、mtime、atime 转自:http://www.blogjava.net/yrJavaWorld/archive/2007/03/13/103602.html