Chapter 17. System monitoring for the IBM Data Server Driver
for JDBC and SQLJ
To assist you in monitoring the performance of your applications with the IBM
Data Server Driver for JDBC and SQLJ, the driver provides two methods to collect
information for a connection.
That information is:
Core driver time
The sum of elapsed monitored API times that were collected while system
monitoring was enabled, in microseconds. In general, only APIs that might
result in network I/O or database server interaction are monitored.
Network I/O time
The sum of elapsed network I/O times that were collected while system
monitoring was enabled, in microseconds.
Server time
The sum of all reported database server elapsed times that were collected
while system monitoring was enabled, in microseconds.
Currently, IBM Informix Dynamic Server databases do not support this
function.
Application time
The sum of the application, JDBC driver, network I/O, and database server
elapsed times, in milliseconds.
The two methods are:
v The DB2SystemMonitor interface
v The TRACE_SYSTEM_MONITOR trace level
To collect system monitoring data using the DB2SystemMonitor interface: Perform these
basic steps:
1. Invoke the DB2Connection.getDB2SystemMonitor method to create a
DB2SystemMonitor object.
2. Invoke the DB2SystemMonitor.enable method to enable the DB2SystemMonitor
object for the connection.
3. Invoke the DB2SystemMonitor.start method to start system monitoring.
4. When the activity that is to be monitored is complete, invoke
DB2SystemMonitor.stop to stop system monitoring.
5. Invoke the DB2SystemMonitor.getCoreDriverTimeMicros,
DB2SystemMonitor.getNetworkIOTimeMicros,
DB2SystemMonitor.getServerTimeMicros,or
DB2SystemMonitor.getApplicationTimeMillis methods to retrieve the elapsed
time data.
For example, the following code demonstrates how to collect each type of elapsed
time data. The numbers to the right of selected statements correspond to the
previously described steps.
© Copyright IBM Corp. 1998, 2008 493