Jump to: navigation, search

Difference between revisions of "Jetty/Feature/Statistics"

< Jetty‎ | Feature
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Jetty Feature
 
{{Jetty Feature
 
| introduction =  
 
| introduction =  
 +
 +
{{Jetty Redirect|http://www.eclipse.org/jetty/documentation/current/statistics-handler.html}}
 +
 
Jetty currently has two levels of request statistic collection:
 
Jetty currently has two levels of request statistic collection:
* Subclasses of [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java?root=RT_Jetty&view=markup AbstractConnector] class optionally can collect statistics about connections.
+
* Subclasses of [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java?root=RT_Jetty&view=markup AbstractConnector] class optionally can collect statistics about connections as well as number of requests.
 
* The [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java?root=RT_Jetty&view=markup StatisticsHandler] class may be used to collect request statistics.
 
* The [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java?root=RT_Jetty&view=markup StatisticsHandler] class may be used to collect request statistics.
  
In addition to that, subclasses of [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java?revision=1213&root=RT_Jetty&view=markup AbstractSessionHandler] optionally can collect session statistics.
+
In addition to that, subclasses of [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java?revision=1213&root=RT_Jetty&view=markup AbstractSessionHandler] class optionally can collect session statistics.
 
   
 
   
 
AbstractConnector and AbstractSessionHandler statistics are turned off by default and must either be configured manually for each instance or turned on via JMX interface. The Statistics Handler is not included in default Jetty configuration, and needs to be configured manually.  
 
AbstractConnector and AbstractSessionHandler statistics are turned off by default and must either be configured manually for each instance or turned on via JMX interface. The Statistics Handler is not included in default Jetty configuration, and needs to be configured manually.  
Line 11: Line 14:
 
To view statistics, you have to be able to connect to Jetty using either JConsole or some other JMX agent.
 
To view statistics, you have to be able to connect to Jetty using either JConsole or some other JMX agent.
 
| body =
 
| body =
==Connector statistics==
+
===Connector statistics===
  
 
Detailed statistics on connection duration and number of requests are only collated when a connection is closed. The current and maximum number of connections are the only "live" statistics.  To learn how to turn on connector statistics please see [[Jetty/Tutorial/Statistics|Jetty Statistics tutorial]], although this is not recommended and it is best to use a JMX agent to select statistics only when needed.
 
Detailed statistics on connection duration and number of requests are only collated when a connection is closed. The current and maximum number of connections are the only "live" statistics.  To learn how to turn on connector statistics please see [[Jetty/Tutorial/Statistics|Jetty Statistics tutorial]], although this is not recommended and it is best to use a JMX agent to select statistics only when needed.
  
==Request Statistics==
+
===Request Statistics===
  
To collect request statistics a StatisticsHandler must be configured as one of the handlers of the server. Typically this can be done as the top level handler, but you may choose to configure a statistics handler for just one context by creating a context configuration file. To learn how to configure a top level statistics handler, please see [[Jetty/Tutorial/Statistics|Jetty Statistics tutorial]].
+
To collect request statistics a [http://download.eclipse.org/jetty/stable-8/apidocs/org/eclipse/jetty/server/handler/StatisticsHandler.html StatisticsHandler] must be configured as one of the handlers of the server. Typically this can be done as the top level handler, but you may choose to configure a statistics handler for just one context by creating a context configuration file. To learn how to configure a top level statistics handler, please see [[Jetty/Tutorial/Statistics|Jetty Statistics tutorial]].
  
==Session Statistics==
+
===Session Statistics===
  
Session handling is built into Jetty for any servlet or webapp context. Detailed statistics on session duration are only collated when a session is closed. The current, minimum, and maximum number of sessions are the only "live" statistics. To learn how to turn on session statistics for a single context please see [[Jetty/Tutorial/Statistics|Jetty Statistics tutorial]], although this is not recommended and it is best to use a JMX agent to select statistics only when needed.
+
Session handling is built into Jetty for any servlet or webapp context. Detailed statistics on session duration are only collated when a session is closed. The current, minimum, and maximum number of sessions are the only "live" statistics. The session statistics are enabled by default and do not need to be configured.
 
| more =
 
| more =
See [http://wiki.eclipse.org/Jetty/Tutorial/JMX Jetty JMX tutorial] for instructions on how to configure Jetty JMX integration.
+
See [[Jetty/Tutorial/JMX|Jetty JMX tutorial]] for instructions on how to configure Jetty JMX integration.
 
| category = [[Category:Jetty Feature]]
 
| category = [[Category:Jetty Feature]]
 
}}
 
}}

Latest revision as of 15:11, 30 April 2013



Introduction


Jetty currently has two levels of request statistic collection:

  • Subclasses of AbstractConnector class optionally can collect statistics about connections as well as number of requests.
  • The StatisticsHandler class may be used to collect request statistics.

In addition to that, subclasses of AbstractSessionHandler class optionally can collect session statistics.

AbstractConnector and AbstractSessionHandler statistics are turned off by default and must either be configured manually for each instance or turned on via JMX interface. The Statistics Handler is not included in default Jetty configuration, and needs to be configured manually.

To view statistics, you have to be able to connect to Jetty using either JConsole or some other JMX agent.

Feature

Connector statistics

Detailed statistics on connection duration and number of requests are only collated when a connection is closed. The current and maximum number of connections are the only "live" statistics. To learn how to turn on connector statistics please see Jetty Statistics tutorial, although this is not recommended and it is best to use a JMX agent to select statistics only when needed.

Request Statistics

To collect request statistics a StatisticsHandler must be configured as one of the handlers of the server. Typically this can be done as the top level handler, but you may choose to configure a statistics handler for just one context by creating a context configuration file. To learn how to configure a top level statistics handler, please see Jetty Statistics tutorial.

Session Statistics

Session handling is built into Jetty for any servlet or webapp context. Detailed statistics on session duration are only collated when a session is closed. The current, minimum, and maximum number of sessions are the only "live" statistics. The session statistics are enabled by default and do not need to be configured.

Additional Resources

See Jetty JMX tutorial for instructions on how to configure Jetty JMX integration.