How can I measure the latency between a Websphere Application and the DB?

Viewed 97

I would like to measure the latency between my application which is running under Websphere and an Oracle DB. Is it possible to do this without making any changes to the Websphere application? For example, is there anything within the Performance Monitoring Infrastructure (PMI) or the Tivoli Performance Viewer that will give me this metric?

I see some possibilities, but nothing really seems to meet my needs.

Can I use the test database connection as detailed here https://www.ibm.com/support/pages/how-set-websphere-test-database-connections-prior-using-them ? If I tested every connection with "select 1 from dual" and found in some log how long it took to answer would that work?

What about using the admin console under Resource/Data Sources/Test Connection? This might work if it measured the time to check but I can't see where I would get the resulting latency.

1 Answers

You could keep it simple: use a stopwatch in the code. Start the timer before making the call, stop it when it returns, and calculate the duration in milliseconds. Log the outcome and plot the distribution.

This will include the network round trip and the database processing time.

Is it important to separate the two?

If yes, you'll need a way to measure the database processing on the Oracle server separately.

Related