Change pg_test_timing to measure in nanoseconds not microseconds.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2025 15:23:15 +0000 (11:23 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2025 15:23:15 +0000 (11:23 -0400)
commit0b096e379e6f9bd49d38020d880a7da337e570ad
treea5175fa4dc74d1dc92c5a79b8036841f607eeaeb
parenta27893df45ec5d8c657899202e9cf0b9a816fe2f
Change pg_test_timing to measure in nanoseconds not microseconds.

Most of our platforms have better-than-microsecond timing resolution,
so the original definition of this program is getting less and less
useful.  Make it report nanoseconds not microseconds.  Also, add a
second output table that reports the exact observed timing durations,
up to a limit of 1024 ns; and be sure to report the largest observed
duration.

The documentation for this program included a lot of system-specific
details that now seem largely obsolete.  Move all that text to the
PG wiki, where perhaps it will be easier to maintain and update.

Also, improve the TAP test so that it actually runs a short standard
run, allowing most of the code to be exercised; its coverage before
was abysmal.

Author: Hannu Krosing <hannuk@google.com>
Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: http://postgr.es/m/be0339cc-1ae1-4892-9445-8e6d8995a44d@eisentraut.org
doc/src/sgml/ref/pgtesttiming.sgml
src/bin/pg_test_timing/pg_test_timing.c
src/bin/pg_test_timing/t/001_basic.pl