add documentation section for IncludeExcludeConnectionStatistics

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-09-16 16:12:10 +10:00
parent fbaabf5c8f
commit 2b18457113
1 changed files with 35 additions and 19 deletions

View File

@ -48,25 +48,6 @@ _____
To view statistics, you have to be able to connect to Jetty using either JConsole or some other JMX agent. See xref:using-jmx[] for more information.
_____
[[connection-statistics]]
==== Connection Statistics
Detailed statistics on connection duration and number of messages are only collated when a connection is closed.
The current and maximum number of connections are the only "live" statistics.
The following example shows how to turn on connection statistics in the Jetty XML format.
[source, xml, subs="{sub-order}"]
----
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBeanToAllConnectors">
<Arg>
<New class="org.eclipse.jetty.io.ConnectionStatistics"/>
</Arg>
</Call>
</Configure>
----
[[request-statistics]]
==== Request Statistics
@ -88,6 +69,41 @@ The following fragment shows how to configure a top level statistics handler:
</Configure>
----
[[connection-statistics]]
==== Connection Statistics
Detailed statistics on connection duration and number of messages are only collated when a connection is closed.
The current and maximum number of connections are the only "live" statistics.
The following example shows how to turn on connection statistics in the Jetty XML format.
[source, xml, subs="{sub-order}"]
----
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBeanToAllConnectors">
<Arg>
<New class="org.eclipse.jetty.io.ConnectionStatistics"/>
</Arg>
</Call>
</Configure>
----
A special variant of `ConnectionStatistics` called `IncludeExcludeConnectionStatistics` allows you to refine which types of connection you want to collect statistics for.
The following example shows how this can be used to record statistics only for WebSocket connections.
[source, xml, subs="{sub-order}"]
----
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBeanToAllConnectors">
<Arg>
<New class="org.eclipse.jetty.io.IncludeExcludeConnectionStatistics">
<Call name="include" arg="org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection"/>
</New>
</Arg>
</Call>
</Configure>
----
[[session-statistics]]
==== Session Statistics