Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 15. Configuring HTTP Response Time Metrics for JBoss EAP/AS 5
15.1. Installing the Response Time Filters Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
To collect response time metrics for a JBoss EAP/AS 5 server, first install the JAR containing the JBoss ON response time servlet filter, and then configure the EAP/AS server to use it.
- Download the Response Time servlet filter connector from the JBoss ON UI.
Note
This can also be done from the command line usingwget:wget http://server.example.com:7080/downloads/connectors/connector-rtfilter.zip
[root@server ~]# wget http://server.example.com:7080/downloads/connectors/connector-rtfilter.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Click the Administration tab in the top menu.
- In the Configuration menu box on the left, select the item.
- Click the connector-rtfilter.zip link, and save the file.
- Unzip the connectors.
unzip connector-rtfilter.zip
[root@server ~]# unzip connector-rtfilter.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
rhq-rtfilter-version.jarfile into thelib/directory for the profile.cp connector-rtfilter/rhq-rtfilter-version.jar JbossHomeDir/lib/server/profileName/lib/
[root@server ~]# cp connector-rtfilter/rhq-rtfilter-version.jar JbossHomeDir/lib/server/profileName/lib/Copy to Clipboard Copied! Toggle word wrap Toggle overflow JBoss EAP/AS already includes thecommons-logging.jarfile, which is also required for response time filtering. - Then configure the
web.xmlfile for the EAP/AS instance.The response time filter can be deployed globally, for all web applications hosted by the EAP/AS instance or it can be configured for a specific web application.To configure it globally, edit the globalweb.xmlfile:vim JbossHomeDir/server/configName/default/deploy/jbossweb.sar/
[root@server ~]# vim JbossHomeDir/server/configName/default/deploy/jbossweb.sar/Copy to Clipboard Copied! Toggle word wrap Toggle overflow To configure it for a single web app, edit that one web app'sweb.xmlfile:vim WARLocation/WEB-INF/web.xml
[root@server ~]# vim WARLocation/WEB-INF/web.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the filter and, depending on the configuration, filter mapping elements to the file. This activates the response time filtering.All that is required for response time filtering to work is the default
<filter>element, without any optional parameters. However, the parameters can be uncommented and set as necessary; the different ones are described in Table 15.1, “Parameters Available for User-Defined <filter> Settings”.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the JBoss EAP/AS server to load the new
web.xmlsettings.
|
Parameter
|
Description
|
|---|---|
|
chopQueryString
|
Only the URI part of a query will be logged if this parameter is set to true. Otherwise the whole query line will be logged. Default is true.
|
|
logDirectory
|
The directory where the log files will be written to. Default setting is {
jboss.server.log.dir}/rt/ (usually server/xxx/log/rt). If this property is not defined, the fallback is {java.io.tmpdir}/rt/ (/tmp/ on UNIX®, and ~/Application Data/Local Settings/Temp – check the TEMP environment variable) is used. If you specify this init parameter, no directory rt/ will be created, but the directory you have provided will be taken literally.
|
|
logFilePrefix
|
A prefix that is put in front of the log file names. Default is the empty string.
|
|
dontLogRegEx
|
A regular expression that is applied to query strings. See java.util.regex.Pattern. If the parameter is not given or an empty string, no pattern is applied.
|
|
matchOnUriOnly
|
Should the dontLogRegEx be applied to the URI part of the query (true) or to the whole query string (false). Default is true.
|
|
timeBetweenFlushesInSec
|
Log lines are buffered by default. When the given number of seconds have passed and a new request is received, the buffered lines will be flushed to disk even if the number of lines to flush after (see next point) is not yet reached.. Default value is 60 seconds (1 Minute).
|
|
flushAfterLines
|
Log lines are buffered by default. When the given number of lines have been buffered, they are flushed to disk. Default value is 10 lines.
|
|
maxLogFileSize
|
The maximum allowed size, in bytes, of the log files; if a log file exceeds this limit, the filter will truncate it; the default value is 5242880 (5 MB).
|
|
vHostMappingFile
|
This properties file must exist on the Tomcat process classpath. For example, in the ../conf/vhost-mappings.properties. The file contains mappings from the 'incoming' vhost (server name) to the vhost that should be used as the prefix in the response time log file name. If no mapping is present (no file or no entry response times are set), then the incoming vhost (server name) is used. For example:
pickeldi.users.acme.com=pickeldi pickeldi= %HOST%=
The first mapping states that if the incoming vhost is 'host1.users.acme.com', then the log file name should get a vhost of 'host1' as prefix, separated by a _ from the context root portion. The second mapping states that if the 'incoming' vhost is 'host1', then no prefix, and no _, should be used. The third mapping uses a special left-hand-side token, '%HOST%'. This mapping states that if the 'incoming' vhost is a representation of localhost then no prefix, and no _ , should be used.
%HOST% will match the host name, or canonical host name or IP address, as returned by the implementation of InetAddress.getLocalHost().
The second and third mappings are examples of empty right hand side, but could just as well have provided a vhost.
This is a one time replacement. There is no recursion in the form that the result of the first line would then be applied to the second one.
|