You can configure response-time monitoring for EJB, CORBA, PowerBuilder, and Web components.
For components, threshold monitoring requires a thread monitor with a hard thread limit. When the response-time threshold is reached, subsequent calls to the component must acquire the thread monitor before proceeding. After the average response time drops below the threshold, new invocations are allowed to proceed normally. To define a thread monitor, follow the instructions in “Monitoring threads” in Chapter 3, “Creating and Configuring Servers,” in the System Administration Guide. Set the thread limit to a low number, for example 10. You can also define the thread monitor in an Ant configuration file, for example:
<project name="MyThreadMonitor"> <import file="ant-config-tasks.xml"/> <target name="configure"> <setProperties threadMonitor="MyThreadMonitor"> <property name="maximumActiveThreads" value="10"/> </setProperties> </target> </project>
After you have defined a thread monitor, threshold monitoring can be applied with the <performanceMonitor> Ant command run inside the <setProperties> task. For example:
<setProperties component="ejb.components.myjar.MyCompRemote"> <performanceMonitor maxResponseTime="5000" threadMonitor="MyMonitor"/> </setProperties>
The maxResponseTime
value
specifies the maximum allowed response time in milliseconds. The threadMonitor
value
specifies the thread monitor that must be acquired by new requests
when the average response time exceeds the maximum. The component
value
specifies the name of the DJC component that runs the application
component that you want to monitor. Set this depending on the application
component type, as follows:
For enterprise JavaBeans components, specify the DJC component that corresponds to the remote or local interface. If configuring an entity bean with finder methods that perform heavy processing, consider applying the same performanceMonitor configuration to the DJC component that corresponds to the home interface. You can read the DJC component names from the EJB module’s Ant configuration file that was generated by deployment.
For CORBA and PowerBuilder components, specify the
DJC component that corresponds to the remote interface of the EJB
session bean that wraps your component. This name is ejb.components.package.componentRemote
,
where package is the CORBA package name, and component is
the component name.
For Web components, specify the DJC component that corresponds to the servlet or JSP that the settings apply to. You can read the DJC component names from the Web application’s Ant configuration file that was generated by deployment.