Documentation: Minor textual/formatting improvements

Updated `README.md` and `USER_GUIDE.md`, improved wording
and formatting. Slightly updated description in `META.json`.

Signed-off-by: Lenz Grimmer <lenz.grimmer@percona.com>
pull/104/head
Lenz Grimmer 2021-09-09 11:05:31 +02:00
parent 0ceef74071
commit 40e6dff0f9
3 changed files with 20 additions and 20 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "pg_stat_monitor", "name": "pg_stat_monitor",
"abstract": "PostgreSQL Query Performance Monitoring Tool", "abstract": "PostgreSQL Query Performance Monitoring Tool",
"description": "The pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL's contrib module pg_stat_statements. PostgreSQLs pg_stat_statements provides the basic statistics, which is sometimes not enough. The major shortcoming in pg_stat_statements is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user needs to calculate the aggregate which is quite expensive.", "description": "pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL's contrib module pg_stat_statements. PostgreSQLs pg_stat_statements provides the basic statistics, which is sometimes not enough. The major shortcoming in pg_stat_statements is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation.",
"version": "0.9.2-beta1", "version": "0.9.2-beta1",
"maintainer": [ "maintainer": [
"ibrar.ahmed@percona.com" "ibrar.ahmed@percona.com"

View File

@ -7,11 +7,11 @@
## What is pg_stat_monitor? ## What is pg_stat_monitor?
The **pg_stat_monitor** is a **Query Performance Monitoring** tool for [Percona Distribution for PostgreSQL](https://www.percona.com/software/postgresql-distribution) and PostgreSQL. **pg_stat_monitor** is based on PostgreSQL's contrib module ``pg_stat_statements``. pg_stat_statements provides the basic statistics, which is sometimes not enough. The major shortcoming in pg_stat_statements is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user needs to calculate the aggregate which is quite expensive. **pg_stat_monitor** is a **Query Performance Monitoring** tool for [Percona Distribution for PostgreSQL](https://www.percona.com/software/postgresql-distribution) and PostgreSQL. **pg_stat_monitor** is based on PostgreSQL's contrib module ``pg_stat_statements``. ``pg_stat_statements`` provides the basic statistics, which is sometimes not enough. The major shortcoming in ``pg_stat_statements`` is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation.
**pg_stat_monitor** is developed on the basis of pg_stat_statements as its more advanced replacement. It provides all the features of pg_stat_statements plus its own feature set. **pg_stat_monitor** is developed on the basis of pg_stat_statements as is a more advanced replacement. It provides all the features of pg_stat_statements plus its own feature set.
### How pg_stat_monitor works? ### How does pg_stat_monitor work?
``pg_stat_monitor`` accumulates the information in the form of buckets. All the aggregated information is bucket based. The size of a bucket and the number of buckets should be configured using GUC (Grand Unified Configuration). When a bucket time elapses, ``pg_stat_monitor`` resets all the statistics and switches to the next bucket. After the last bucket elapses, ``pg_stat_monitor`` goes back to the first bucket. All the data on the first bucket is cleared out with new writes; therefore, to not lose the data, users must read the buckets before that. ``pg_stat_monitor`` accumulates the information in the form of buckets. All the aggregated information is bucket based. The size of a bucket and the number of buckets should be configured using GUC (Grand Unified Configuration). When a bucket time elapses, ``pg_stat_monitor`` resets all the statistics and switches to the next bucket. After the last bucket elapses, ``pg_stat_monitor`` goes back to the first bucket. All the data on the first bucket is cleared out with new writes; therefore, to not lose the data, users must read the buckets before that.
@ -26,7 +26,7 @@ The **pg_stat_monitor** is a **Query Performance Monitoring** tool for [Percona
9. [Copyright Notice](#copyright-notice) 9. [Copyright Notice](#copyright-notice)
## Supported PostgreSQL Versions ## Supported PostgreSQL Versions
The ``pg_stat_monitor`` should work on the latest version of both [Percona Distribution for PostgreSQL](https://www.percona.com/software/postgresql-distribution) and PostgreSQL but is only tested with these versions: ``pg_stat_monitor`` should work on the latest version of both [Percona Distribution for PostgreSQL](https://www.percona.com/software/postgresql-distribution) and PostgreSQL and is currently tested against thes following versions:
| Distribution | Version | Supported | | Distribution | Version | Supported |
| ------------------------------------|---------|--------------------| | ------------------------------------|---------|--------------------|
@ -45,7 +45,7 @@ You can install ``pg_stat_monitor`` from [Percona repositories](#installing-from
### Installing from Percona repositories ### Installing from Percona repositories
``pg_stat_monitor`` is supplied as part of Percona Distribution for PostgreSQL. The rpm/deb packages are available from Percona repositories. To install ``pg_stat_monitor``, follow [the installation instructions](https://www.percona.com/doc/postgresql/LATEST/installing.html). ``pg_stat_monitor`` is supplied as part of Percona Distribution for PostgreSQL. The RPM/DEB packages are available from Percona's repositories. To install ``pg_stat_monitor``, follow [the installation instructions](https://www.percona.com/doc/postgresql/LATEST/installing.html).
### Installing from PGXN ### Installing from PGXN
@ -73,9 +73,9 @@ make USE_PGXS=1 install
``` ```
## Setup ## Setup
``pg_stat_monitor`` cannot be enabled in your running ``postgresql`` instance. ``pg_stat_monitor`` needs to be loaded at the start time. This requires adding the ``pg_stat_monitor`` extension for the ``shared_preload_libraries`` parameter and restarting the ``postgresql`` instance. ``pg_stat_monitor`` cannot be enabled in your running ``postgresql`` instance, it needs to be loaded at the start time. This requires adding the ``pg_stat_monitor`` extension to the ``shared_preload_libraries`` parameter and restarting the ``postgresql`` instance.
You can set the ``pg_stat_monitor`` extension in the ``postgresql.conf`` file. You can set the ``pg_stat_monitor`` extension in the ``postgresql.conf`` file.
``` ```
# - Shared Library Preloading - # - Shared Library Preloading -
@ -134,11 +134,11 @@ SELECT decode_error_level(elevel) AS elevel, sqlcode, query, message FROM pg_st
``` ```
To learn more about ``pg_stat_monitor`` configuration and usage, see [User Guide](https://github.com/percona/pg_stat_monitor/blob/master/docs/USER_GUIDE.md). To learn more about ``pg_stat_monitor`` configuration and usage, see the [User Guide](https://github.com/percona/pg_stat_monitor/blob/master/docs/USER_GUIDE.md).
## Submitting Bug Reports ## Submitting Feature Requests or Bug Reports
If you found a bug in ``pg_stat_monitor``, please submit the report to the [Jira issue tracker](https://jira.percona.com/projects/PG/issues). If you would like to request a feature of if you found a bug in ``pg_stat_monitor``, please submit the report to the [Jira issue tracker](https://jira.percona.com/projects/PG/issues).
Start by searching the open tickets for a similar report. If you find that someone else has already reported your issue, then you can upvote that report to increase its visibility. Start by searching the open tickets for a similar report. If you find that someone else has already reported your issue, then you can upvote that report to increase its visibility.

View File

@ -34,7 +34,7 @@ SELECT * FROM pg_stat_monitor_settings;
``` ```
Some configuration parameters require the server restart and should be set before the server startup. These must be set in the ``postgresql.conf`` file. Other parameters do not require server restart and can be set permanently either in the ``postgresql.conf`` or from the client (``psql``). Some configuration parameters require a server restart and should be set before the server startup. These must be set in the ``postgresql.conf`` file. Other parameters do not require a server restart and can be set permanently either in the ``postgresql.conf`` or from the client (``psql``).
The table below shows set up options for each configuration parameter and whether the server restart is required to apply the parameter's value: The table below shows set up options for each configuration parameter and whether the server restart is required to apply the parameter's value:
@ -68,7 +68,7 @@ The table below shows set up options for each configuration parameter and whethe
### Usage ### Usage
pg_stat_monitor extension contains a view called pg_stat_monitor, which contains all the monitoring information. Find the list of columns in pg_stat_monitor view in the following table. The table also shows whether a particular column is available in pg_stat_statements. The ``pg_stat_monitor`` extension contains a view called ``pg_stat_monitor``, which containss all the monitoring information. Find the list of columns in ``pg_stat_monitor`` view in the following table. The table also shows whether a particular column is available in ``pg_stat_statements``.
|      Column        |           Type           | pg_stat_monitor      | pg_stat_statements |      Column        |           Type           | pg_stat_monitor      | pg_stat_statements
@ -153,18 +153,18 @@ bucket | bucket_start_time |
#### Query Information #### Query Information
**`userid`**: An ID of the user to whom that query belongs. pg_stat_monitor collects queries from all the users and uses the `userid` to segregate the queries based on different users. **`userid`**: An ID of the user to whom that query belongs. ``pg_stat_monitor`` collects queries from all the users and uses the `userid` to segregate the queries based on different users.
**`dbid`**: The database ID of the query. pg_stat_monitor accumulates queries from all the databases; therefore, this column is used to identify the database. **`dbid`**: The database ID of the query. ``pg_stat_monitor`` accumulates queries from all the databases; therefore, this column is used to identify the database.
**`queryid`**:  pg_stat_monitor generates a unique ID for each query (queryid). **`queryid`**: ``pg_stat_monitor`` generates a unique ID for each query (queryid).
**`query`**: The query column contains the actual text of the query. This parameter depends on the **`pg_stat_monitor.pgsm_normalized_query`** configuration parameters, in which format to show the query. **`query`**: The query column contains the actual text of the query. This parameter depends on the **`pg_stat_monitor.pgsm_normalized_query`** configuration parameters, in which format to show the query.
**`calls`**: Number of calls of that particular query. **`calls`**: Number of calls of that particular query.
##### Example 1: Shows the usename, database name, unique queryid hash, query, and the total number of calls of that query. ##### Example: Shows the usename, database name, unique queryid hash, query, and the total number of calls of that query.
```sql ```sql
postgres=# SELECT userid, datname, queryid, substr(query,0, 50) AS query, calls FROM pg_stat_monitor; postgres=# SELECT userid, datname, queryid, substr(query,0, 50) AS query, calls FROM pg_stat_monitor;
userid | datname | queryid | query | calls userid | datname | queryid | query | calls
@ -186,7 +186,7 @@ postgres=# SELECT userid, datname, queryid, substr(query,0, 50) AS query, calls
``` ```
##### Example 4: Shows the connected application_name. ##### Example: Shows the connected application_name.
```sql ```sql
SELECT application_name, query FROM pg_stat_monitor; SELECT application_name, query FROM pg_stat_monitor;
@ -295,7 +295,7 @@ postgres=# SELECT * FROM histogram(0, 'F44CD1B4B33A47AF') AS a(range TEXT, freq
(10 rows) (10 rows)
``` ```
There are 10 timebase buckets of the time **`pg_stat_monitor.pgsm_respose_time_step`** in the field ``resp_calls``. The value in the field shows how many queries run in that period of time. There are 10 timebase buckets of the time **`pg_stat_monitor.pgsm_respose_time_step`** in the field ``resp_calls``. The field's value shows how many queries run in that period of time.
#### Object Information. #### Object Information.
@ -337,7 +337,7 @@ View definition:
    bar b;     bar b;
``` ```
Now when we query the pg_stat_monitor, it will show the view name and also all the table names in the view. Now when we query ``pg_stat_monitor``, it will show the view name and also all the table names in the view.
```sql ```sql
SELECT relations, query FROM pg_stat_monitor; SELECT relations, query FROM pg_stat_monitor;
      relations      |                                                query                                                       relations      |                                                query