oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

logStatistics() method is not correctly explained in docs #1655

Closed danieldiazastudillo closed 3 months ago

danieldiazastudillo commented 3 months ago
  1. What is the link to the documentation section that needs improving? https://node-oracledb.readthedocs.io/en/latest/user_guide/connection_handling.html#connection-pool-monitoring

  2. Describe the confusion The code snippet provided to explain logging it's calling from poolStatistics when it should be calling from the pool variable

    
    const poolstatistics = pool.getStatistics();

console.log(poolstatistics.currentQueueLength); // print one attribute poolstatistics.logStatistics(); // print all statistics to the console. (WRONG!)


3. Suggest changes that would help
```js
const poolstatistics = pool.getStatistics();

console.log(poolstatistics.currentQueueLength);  // print one attribute
pool.logStatistics(); // print all statistics to the console. (WRONG!)
sharadraju commented 3 months ago

Thank you for using node-oracledb. There are two ways to log the pool statistics. One is by using the poolStatistics object, which we have shown here and the other is to use the pool object. The poolStatistics object is different from the pool object and it can be used to log the pool statistics.

We have also mentioned in the very next line in connection pool monitoring user guide about how to log statistics using the pool object.

monita1208 commented 3 months ago

Both pool.logStatistics() and poolstatistics.logStatistics() are identical with same result and can use either of them. You have to use poolStatistics class object to access single attribute data.