1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

Add pg_stat_archiver statistics view.

This view shows the statistics about the WAL archiver process's activity.

Gabriele Bartolini, reviewed by Michael Paquier, refactored a bit by me.
This commit is contained in:
Fujii Masao
2014-01-29 02:58:22 +09:00
parent 98d62c28fd
commit 9132b189bf
9 changed files with 327 additions and 19 deletions

View File

@ -269,6 +269,14 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</entry>
</row>
<row>
<entry><structname>pg_stat_archiver</><indexterm><primary>pg_stat_archiver</primary></indexterm></entry>
<entry>One row only, showing statistics about the
WAL archiver process's activity. See
<xref linkend="pg-stat-archiver-view"> for details.
</entry>
</row>
<row>
<entry><structname>pg_stat_bgwriter</><indexterm><primary>pg_stat_bgwriter</primary></indexterm></entry>
<entry>One row only, showing statistics about the
@ -648,6 +656,63 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</para>
</note>
<table id="pg-stat-archiver-view" xreflabel="pg_stat_archiver">
<title><structname>pg_stat_archiver</structname> View</title>
<tgroup cols="3">
<thead>
<row>
<entry>Column</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><structfield>archived_count</></entry>
<entry><type>bigint</type></entry>
<entry>Number of WAL files that have been successfully archived</entry>
</row>
<row>
<entry><structfield>last_archived_wal</></entry>
<entry><type>text</type></entry>
<entry>Name of the last WAL file successfully archived</entry>
</row>
<row>
<entry><structfield>last_archived_time</></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Time of the last successful archive operation</entry>
</row>
<row>
<entry><structfield>failed_count</></entry>
<entry><type>bigint</type></entry>
<entry>Number of failed attempts for archiving WAL files</entry>
</row>
<row>
<entry><structfield>last_failed_wal</></entry>
<entry><type>text</type></entry>
<entry>Name of the WAL file of the last failed archival operation</entry>
</row>
<row>
<entry><structfield>last_failed_time</></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Time of the last failed archival operation</entry>
</row>
<row>
<entry><structfield>stats_reset</></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Time at which these statistics were last reset</entry>
</row>
</tbody>
</tgroup>
</table>
<para>
The <structname>pg_stat_archiver</structname> view will always have a
single row, containing data about the archiver process of the cluster.
</para>
<table id="pg-stat-bgwriter-view" xreflabel="pg_stat_bgwriter">
<title><structname>pg_stat_bgwriter</structname> View</title>
@ -1613,6 +1678,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
argument (requires superuser privileges).
Calling <literal>pg_stat_reset_shared('bgwriter')</> will zero all the
counters shown in the <structname>pg_stat_bgwriter</> view.
Calling <literal>pg_stat_reset_shared('archiver')</> will zero all the
counters shown in the <structname>pg_stat_archiver</> view.
</entry>
</row>