Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bface17

Browse files
author
Liudmila Mantrova
committed
Bug fixes in pg-wait-sampling docs
1 parent 6383ae3 commit bface17

File tree

1 file changed

+22
-45
lines changed

1 file changed

+22
-45
lines changed

doc/src/sgml/pg-wait-sampling.sgml

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<title>pg_wait_sampling</title>
55
<para>
66
<filename>pg_wait_sampling</filename> is a <productname>&productname;</productname> extension for
7-
collecting sampling-based statistics for wait events.
7+
collecting sampling-based statistics on wait events.
88
</para>
99
<para>
10-
Starting from the 9.6 version, <productname>PostgreSQL</productname> provides information about
10+
Starting from the 9.6 version, <productname>&productname;</productname> provides information about
1111
the current wait events for particular processes. However, to get
1212
descriptive statistics of the server activity, you have to sample
1313
wait events multiple times. The
@@ -17,18 +17,18 @@
1717
<listitem>
1818
<para>
1919
<emphasis>Waits history</emphasis> &mdash; the list of wait events for
20-
recent processes, with timestamps
20+
recent processes, with timestamps.
2121
</para>
2222
</listitem>
2323
<listitem>
2424
<para>
25-
<emphasis>Waits profile</emphasis> &mdash; the number wait event samples for all processes over time, per wait event type
25+
<emphasis>Waits profile</emphasis> &mdash; the number of wait event samples for all processes over time, per wait event type.
2626
</para>
2727
</listitem>
2828
<listitem>
2929
<para>
3030
Current wait events for all processes, including background
31-
workers
31+
workers.
3232
</para>
3333
</listitem>
3434
</itemizedlist>
@@ -38,7 +38,7 @@
3838
what a particular process is waiting for at each moment of time, and
3939
analyze wait events statistics. For the list of possible wait
4040
events, see
41-
<xref linkend="wait-event-table">
41+
<xref linkend="wait-event-table">.
4242
</para>
4343
<para>
4444
<emphasis role="strong">See Also</emphasis></para>
@@ -50,7 +50,7 @@
5050
<title>Installation</title>
5151
<para>The <filename>pg_wait_sampling</filename> extension is included into <productname>&productname;</productname> and requires no special prerequisites.</para>
5252
<para>
53-
To complete the <filename>pg_wait_sampling</filename> installation:
53+
To enable <filename>pg_wait_sampling</filename>, do the following:
5454
</para>
5555
<orderedlist>
5656
<listitem>
@@ -65,15 +65,11 @@ shared_preload_libraries = 'pg_wait_sampling'
6565
</listitem>
6666
<listitem>
6767
<para>
68-
From the command line, run the following query:
68+
Create the <filename>pg_wait_sampling</filename> extension using the following query:
6969
</para>
7070
<programlisting>
71-
$ psql -d <replaceable>dbname</replaceable> -c &quot;CREATE EXTENSION pg_wait_sampling;&quot;
71+
CREATE EXTENSION pg_wait_sampling;
7272
</programlisting>
73-
<para>
74-
where <replaceable>dbname</replaceable> is the name of the database
75-
for which you would like to use <filename>pg_wait_sampling</filename>.
76-
</para>
7773
</listitem>
7874
<listitem>
7975
<para>
@@ -110,16 +106,14 @@ $ psql -d <replaceable>dbname</replaceable> -c &quot;CREATE EXTENSION pg_wait_sa
110106
<literal>pg_wait_sampling_current</literal> view:
111107
</para>
112108
<programlisting>
113-
CREATE VIEW pg_wait_sampling_current AS
114-
SELECT * FROM pg_wait_sampling_get_current();
109+
SELECT * FROM pg_wait_sampling_get_current;
115110
</programlisting>
116111
<para>
117112
The returned statistics covers all the active processes,
118113
including background workers. To filter the view for a single
119114
process, run <function>pg_wait_sampling_get_current()</function> function specifying the process ID:
120115
</para>
121116
<programlisting>
122-
CREATE VIEW pg_wait_sampling_current AS
123117
SELECT * FROM pg_wait_sampling_get_current(<replaceable>pid</replaceable>);
124118
</programlisting>
125119
<para>
@@ -128,13 +122,11 @@ SELECT * FROM pg_wait_sampling_get_current(<replaceable>pid</replaceable>);
128122
that provides the wait events history for the latest processes:
129123
</para>
130124
<programlisting>
131-
CREATE VIEW pg_wait_sampling_history AS
132-
SELECT * FROM pg_wait_sampling_get_history();
125+
SELECT * FROM pg_wait_sampling_get_history;
133126
</programlisting>
134127
<para>
135128
The returned view displays wait samples per process, with event timestamps. Waits history is implemented as an in-memory ring buffer. By
136-
default, the history size is limited to 5000 samples. If you
137-
would like to save history for a longer period of time, you can
129+
default, the history size is limited to 5000 samples. To save history for a longer period of time, you can
138130
modify the <varname>pg_wait_sampling.history_size</varname>
139131
variable, or connect a client application to periodically read
140132
waits history and dump it to a local storage.
@@ -144,8 +136,7 @@ SELECT * FROM pg_wait_sampling_get_history();
144136
<literal>pg_wait_sampling_profile</literal> view:
145137
</para>
146138
<programlisting>
147-
CREATE VIEW pg_wait_sampling_profile AS
148-
SELECT * FROM pg_wait_sampling_get_profile();
139+
SELECT * FROM pg_wait_sampling_get_profile;
149140
</programlisting>
150141
<para>
151142
Waits profile is stored as an in-memory hash table that
@@ -161,10 +152,10 @@ SELECT * FROM pg_wait_sampling_get_profile();
161152
waits profile from time to time to avoid memory overflow.</para>
162153
</important>
163154
<para>
164-
If you are are not interested in the distribution of wait events
155+
If you are not interested in the distribution of wait events
165156
between processes, you can set the
166157
<varname>pg_wait_sampling.profile_pid</varname> variable to
167-
false. In this case, the <literal>pid</literal> value for each
158+
<literal>false</literal>. In this case, the <literal>pid</literal> value for each
168159
process is set to zero, and wait samples for all the processes
169160
are stored together.
170161
</para>
@@ -229,16 +220,16 @@ SELECT * FROM pg_wait_sampling_get_profile();
229220
</indexterm>
230221
</term>
231222
<listitem>
232-
<para>Sampling mode for waits profile. If set to true, waits
223+
<para>Sampling mode for waits profile. If set to <literal>true</literal>, waits
233224
profile is collected per process. If you set
234225
<literal>pg_wait_sampling.profile_pid</literal> to
235-
false, the sampling profile is collected for all
226+
<literal>false</literal>, waits profile is collected for all
236227
processes together. In this case, the
237228
<literal>pid</literal> value for each process is set to
238229
zero, and the corresponding row contains wait samples
239230
for all the processes.
240231
</para>
241-
<para>Default: true
232+
<para>Default: <literal>true</literal>
242233
</para>
243234
</listitem>
244235
</varlistentry>
@@ -252,7 +243,7 @@ SELECT * FROM pg_wait_sampling_get_profile();
252243
<sect4 id="pg-wait-sampling-current-view">
253244
<title>pg_wait_sampling_current View</title>
254245
<para>
255-
The <literal>pg_wait_sampling_current</literal> view provides
246+
The <structname>pg_wait_sampling_current</structname> view provides
256247
the information about the current wait events for all
257248
processes, including background workers.
258249
</para>
@@ -313,7 +304,7 @@ SELECT * FROM pg_wait_sampling_get_profile();
313304
<sect4 id="pg-wait-sampling-history-view">
314305
<title>pg_wait_sampling_history View</title>
315306
<para>
316-
The <literal>pg_wait_sampling_history</literal> view provides
307+
The <structname>pg_wait_sampling_history</structname> view provides
317308
the history of wait events. This data is stored as an
318309
in-memory ring buffer.
319310
</para>
@@ -385,7 +376,7 @@ SELECT * FROM pg_wait_sampling_get_profile();
385376
<sect4 id="pg-wait-sampling-profile-view">
386377
<title>pg_wait_sampling_profile View</title>
387378
<para>
388-
The <literal>pg_wait_sampling_profile</literal> view provides
379+
The <structname>pg_wait_sampling_profile</structname> view provides
389380
the profile of wait events. This data is stored as an
390381
in-memory hash table.
391382
</para>
@@ -447,7 +438,7 @@ SELECT * FROM pg_wait_sampling_get_profile();
447438
<type>text</type>
448439
</entry>
449440
<entry>
450-
Count of samples
441+
Number of samples
451442
</entry>
452443
</row>
453444
</tbody>
@@ -471,20 +462,6 @@ SELECT * FROM pg_wait_sampling_get_profile();
471462
</itemizedlist></listitem>
472463
</varlistentry>
473464
<varlistentry>
474-
<term><function>pg_wait_sampling_get_history()</function>
475-
<indexterm><primary><function>pg_wait_sampling_get_history</></primary>
476-
</indexterm>
477-
</term>
478-
<listitem><para>Returns the <literal>pg_wait_sampling_history</literal> view with the list of wait events for recent processes, with timestamps.</para></listitem>
479-
</varlistentry>
480-
<varlistentry>
481-
<term><function>pg_wait_sampling_get_profile()</function>
482-
<indexterm><primary><function>pg_wait_sampling_get_profile</function></primary>
483-
</indexterm>
484-
</term>
485-
<listitem><para>Returns the profile of wait events.</para></listitem>
486-
</varlistentry>
487-
<varlistentry>
488465
<term><function>pg_wait_sampling_reset_profile()</function>
489466
<indexterm><primary><function>pg_wait_sampling_reset_profile</function></primary>
490467
</indexterm>

0 commit comments

Comments
 (0)