How to collect statistics
Jetty 6 currently has two levels of statistic collection:
- Connectors optionally collect statistics about connections
- The StatisticsHandler class may be used to collect request statistics.
To view statistics, you must be able to view mbeans with either jconsole or some other
mbean agent. By default Connector statistics are turned off and must either be configured
or turned on via the mbean interface.
Detailed statitics on connection duration and number of requests is only collated when a connection is closed. The current, min and maximum number of connections is the only "live" statistic. The following example shows how to turn on connector statistics in jetty.xml (although this is not recommended and it is best to use an mbean agent to select statistics only when needed).