summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMichael Paquier2025-12-08 06:23:09 +0000
committerMichael Paquier2025-12-08 06:23:09 +0000
commit31280d96a64850f5a9a924088890ab43a2905237 (patch)
tree347d2159af82430e7d845f7ea8dfe078ded707ec /doc/src
parent006dd4b2e5b33a3d0c2780f0bf307f6311ed776b (diff)
test_custom_stats: Test module for custom cumulative statistics
This test module acts as a replacement that existed prior to d52c24b0f808 in the test module injection_points. It uses a more flexible structure than its ancestor: - Two libraries are built, one for fixed-sized stats and one for variable-sized stats. - No GUCs required. The stats are enabled only if one or both libraries are loaded with shared_preload_libraries. - Same kind IDs reserved: 25 (variable-sized) and 26 (fixed-sized) The goal of this redesign is to be able to easier extend the code coverage provided by this module for other changes that are currently under discussion, and injection_points was not suited for these. Injection points are also now widely used in the tree now, so extending more the test coverage for custom pgstats in the test module injection_points would be a riskier long-term move. The new code is mostly a copy of what existed previously in the test module injection_points, with the same callbacks defined for fixed-sized and variable-sized stats, but a simpler overall structure in terms of the stats counters updated. The test coverage should remain the same as previously: one TAP test is used to check data reports, crash recovery and clean restart scenarios. Tests are added for the manual reset of fixed-sized stats, something not tested until now. Author: Sami Imseih <samimseih@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CAA5RZ0sJgO6GAwgFxmzg9MVP=rM7Us8KKcWpuqxe-f5qxmpE0g@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/xfunc.sgml6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index 9cfa5bef36c..8e936af465c 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -3934,6 +3934,12 @@ extern bool InjectionPointDetach(const char *name);
</para>
<para>
+ An example can be found in
+ <filename>src/test/modules/test_custom_stats</filename> in the PostgreSQL
+ source tree.
+ </para>
+
+ <para>
Enabling injection points requires
<option>--enable-injection-points</option> with
<command>configure</command> or <option>-Dinjection_points=true</option>