1- pg \_ wait \_ sampling – sampling based statistics of wait events
1+ ` pg_wait_sampling ` – sampling based statistics of wait events
22=============================================================
33
44Introduction
@@ -7,29 +7,29 @@ Introduction
77PostgreSQL 9.6+ provides an information about current wait event of particular
88process. However, in order to gather descriptive statistics of server
99behavior user have to sample current wait event multiple times.
10- pg \_ wait \_ sampling is an extension for collecting sampling statistics of wait
10+ ` pg_wait_sampling ` is an extension for collecting sampling statistics of wait
1111events.
1212
13- The module must be loaded by addingpg \_ wait \_ sampling to
14- shared \_ preload \_ libraries in postgresql.conf, because it requires additional
13+ The module must be loaded by adding` pg_wait_sampling ` to
14+ ` shared_preload_libraries ` in postgresql.conf, because it requires additional
1515shared memory and launches background worker. This means that a server restart
1616is needed to add or remove the module.
1717
18- Whenpg \_ wait \_ sampling is enabled, it collects two kinds of statistics.
18+ When` pg_wait_sampling ` is enabled, it collects two kinds of statistics.
1919
2020* History of waits events. It's implemented as in-memory ring buffer where
2121 samples of each process wait events are written with given (configurable)
2222 period. Therefore, for each running process user can see some number of
2323 recent samples depending on history size (configurable). Assuming there is
2424 a client who periodically read this history and dump it somewhere, user
25- can have continuous history.
25+ can have continuous history.
2626* Waits profile. It's implemented as in-memory hash table where count
2727 of samples are accumulated per each process and each wait event. This hash
2828 table can be reset by user request. Assuming there is a client who
2929 periodically dumps profile and resets it, user can have statistics of
30- intensivity of wait events among time.
30+ intensivity of wait events among time.
3131
32- pg \_ wait \_ sampling launches special background worker for gathering the
32+ ` pg_wait_sampling ` launches special background worker for gathering the
3333statistics above.
3434
3535Authors
@@ -41,7 +41,7 @@ Authors
4141Availability
4242------------
4343
44- pg \_ wait \_ sampling is realized as an extension and not available in default
44+ ` pg_wait_sampling ` is realized as an extension and not available in default
4545PostgreSQL installation. It is available from
4646[ github] ( https://github.com/postgrespro/pg_wait_sampling )
4747under the same license as
@@ -51,13 +51,13 @@ and supports PostgreSQL 9.6+.
5151Installation
5252------------
5353
54- pg \_ wait \_ sampling is PostgreSQL extension which requires PostgreSQL 9.6 or
55- higher. Before build and install you should ensure following:
56-
54+ ` pg_wait_sampling ` is PostgreSQL extension which requires PostgreSQL 9.6 or
55+ higher. Before build and install you should ensure following:
56+
5757* PostgreSQL version is 9.6 or higher.
5858* You have development package of PostgreSQL installed or you built
5959 PostgreSQL from source.
60- * Your PATH variable is configured so thatpg \_ config command available, or
60+ * Your PATH variable is configured so that` pg_config ` command available, or
6161 set PG_CONFIG variable.
6262
6363Typical installation procedure may look like this:
@@ -69,15 +69,15 @@ Typical installation procedure may look like this:
6969$ make USE_PGXS=1 installcheck
7070$ psql DB -c "CREATE EXTENSION pg_wait_sampling;"
7171
72- Complilation on Windows is not supported, since the extension uses symbols from PostgreSQL
72+ Compilation on Windows is not supported, since the extension uses symbols from PostgreSQL
7373that are not exported.
7474
7575Usage
7676-----
7777
78- pg \_ wait \_ sampling interacts with user by set of views and functions.
78+ ` pg_wait_sampling ` interacts with user by set of views and functions.
7979
80- pg \_ wait \_ sampling \_ current view – information about current wait events for
80+ ` pg_wait_sampling_current ` view – information about current wait events for
8181all processed including background workers.
8282
8383| Column name| Column type| Description|
@@ -86,10 +86,10 @@ all processed including background workers.
8686| event_type| text| Name of wait event type|
8787| event| text| Name of wait event|
8888
89- pg_wait_sampling_get_current(pid int4) returns the same table for single given
89+ ` pg_wait_sampling_get_current(pid int4) ` returns the same table for single given
9090process.
9191
92- pg \_ wait \_ sampling \_ history view – history of wait events obtained by sampling into
92+ ` pg_wait_sampling_history ` view – history of wait events obtained by sampling into
9393in-memory ring buffer.
9494
9595| Column name| Column type| Description|
@@ -99,7 +99,7 @@ in-memory ring buffer.
9999| event_type| text| Name of wait event type|
100100| event| text| Name of wait event|
101101
102- pg \_ wait \_ sampling \_ profile view – profile of wait events obtained by sampling into
102+ ` pg_wait_sampling_profile ` view – profile of wait events obtained by sampling into
103103in-memory hash table.
104104
105105| Column name| Column type| Description|
@@ -109,7 +109,7 @@ in-memory hash table.
109109| event| text| Name of wait event|
110110| count| text| Count of samples|
111111
112- pg_wait_sampling_reset_profile() function resets the profile.
112+ ` pg_wait_sampling_reset_profile() ` function resets the profile.
113113
114114The work of wait event statistics collector worker is controlled by following
115115GUCs.
@@ -121,7 +121,7 @@ GUCs.
121121| pg_wait_sampling.profile_period| int4| Period for profile sampling in milliseconds| 10|
122122| pg_wait_sampling.profile_pid| bool| Whether profile should be per pid| true|
123123
124- Ifpg \_ wait \_ sampling.profile \_ pid is set to false, sampling profile wouldn't be
124+ If` pg_wait_sampling.profile_pid ` is set to false, sampling profile wouldn't be
125125collected in per-process manner. In this case the value of pid could would
126126be always zero and corresponding row contain samples among all the processes.
127127
@@ -137,11 +137,11 @@ for list of possible wait events.
137137Contribution
138138------------
139139
140- Please, notice, thatpg \_ wait \_ sampling is still under development and while
140+ Please, notice, that` pg_wait_sampling ` is still under development and while
141141it's stable and tested, it may contains some bugs. Don't hesitate to raise
142142[ issues at github] ( https://github.com/postgrespro/pg_wait_sampling/issues ) with
143143your bug reports.
144144
145- If you're lacking of some functionality inpg \_ wait \_ sampling and feeling power
145+ If you're lacking of some functionality in` pg_wait_sampling ` and feeling power
146146to implement it then you're welcome to make pull requests.
147147