Projects:DB Pool Logging Utilities/QA
The goal of this module is to produce log depending on pool and database queries/connections. The effort to automate testing for it does not pay off the benefit, therefore only manual tests will be executed on it.
Executed tests consist on ensure all configuration settings work as expected. See configuration for more details about these settings.
This module adds some overhead when it is enabled, when disabled it is negligible.
When tracking connections is enabled, whenever a connections is borrowed, a stack trace of that thread is taken
org.openbravo.util.db.MeasurePerformance.trackConnections measures its impact. Creating 100 connections 1000 times the impact is:
disabled: 77ms - enabled: 81ms - track: 3106ms
So just enabling logs (but actually not logging anything) does not add overhead. The overhead added when connections are tracked is ~3 seconds to create 100K connections. All this overhead is consumed by generating stack traces.
Also checked heap usage, but the impact is not appreciable.
When tracking queries is enabled (minDurationStatements > -1) even queries that are not logged because they take less time to execute than the threshold or because are not part of the tracked ones add some overhead. This overhead also increases if parameter values are tracked and depending on how many parameters the query has. The following measures in milliseconds depict it, they are the time in milliseconds taken to set parameters and execute 10K prepared statements with the given number of parameters. Note these measures do not include actual logging but the overhead to save parameter information:
0 params - disabled: 415 - enabled: 333 - loggingAll: 328 - loggingSome: 234 - noParams:297 10 params - disabled: 350 - enabled: 298 - loggingAll: 381 - loggingSome: 303 - noParams:344 20 params - disabled: 354 - enabled: 362 - loggingAll: 486 - loggingSome: 363 - noParams:437 30 params - disabled: 411 - enabled: 396 - loggingAll: 588 - loggingSome: 422 - noParams:532 40 params - disabled: 450 - enabled: 467 - loggingAll: 681 - loggingSome: 485 - noParams:589 50 params - disabled: 515 - enabled: 542 - loggingAll: 757 - loggingSome: 560 - noParams:680