Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 021cf28

Browse files
committed
Add documentation for Statistic Manager in config guide
1 parent 9d19833 commit 021cf28

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/config.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,34 @@ which can have positive effects on SQL caching and related performance optimizat
252252

253253
By default, no special controls are applied.
254254

255+
Statistic Manager
256+
-----------------
257+
258+
Return a ``StatisticManager`` from the ``getStatisticManager`` method.
259+
260+
``StatisticManager`` manages statistical information related to SQL execution.
261+
It retains the following information for each SQL statement:
262+
263+
- execution count
264+
- execution maximum time in milliseconds
265+
- execution minimum time in milliseconds
266+
- total execution time in milliseconds
267+
- average execution time in milliseconds
268+
269+
Collection of statistical information is disabled by default.
270+
To enable it, do the following:
271+
272+
.. code-block:: java
273+
274+
Config config = ...
275+
config.getStatisticManager().setEnabled(true);
276+
277+
To disable it, call ``setEnabled(false)``.
278+
279+
The default implementation collects statistical information indefinitely while enabled.
280+
To prevent memory exhaustion, either call the ``clear`` method of ``StatisticManager`` periodically
281+
or create an appropriate implementation class for ``StatisticManager``.
282+
255283
Loading JDBC drivers
256284
====================
257285

0 commit comments

Comments
 (0)