Commit Graph

49 Commits (d03fb8f0b7cbc79819f00bb271ebba218c93190d)

Author SHA1 Message Date
Ibrar Ahmed 5ae0f3a0bb PG-518: Internal Functions should NOT be visible in PGSM API. 2022-12-07 14:52:45 +00:00
Ibrar Ahmed f7860b472f
PG-310: Bucket is “Done” vs still being current/last. (#321)
A new column is added to mention that bucket is active or done. there is    
some timing based adjustment was required with that too.   

Co-authored-by: Hamid Akhtar <hamid.akhtar@percona.com>
2022-11-23 02:23:28 +05:00
Ibrar Ahmed a3830624bb PG-544: Regression cleanup. 2022-11-16 19:47:07 +00:00
Ibrar Ahmed bc19c99c0b PG-306: The bucket start time should be timestamp instead of TEXT. 2022-11-15 18:11:10 +00:00
Ibrar Ahmed a392c98b5c PG-518: Drop the internal function permission from PUBLIC.
It will be a security problem to provide the internal function access to PUBLIC.
This commit will revoke all permission of internal functions from PUBLIC.
2022-11-15 17:45:42 +00:00
Ibrar Ahmed 40afdce2eb PG-552: Remove unnecessary columns from PostgreSQL 11 and 12 views.
There was a typo while checking the PostgreSQL version in the SQL file. This commit
will fix the typo, and only the necessary columns will be visible in the view.
2022-11-15 17:10:42 +00:00
Ibrar Ahmed c622bf35a8 PG-174: Code cleanup.
pg_stat_monitor is a bit longer; therefore, it requires some code cleanup.
Therefore I decided to turn these tasks into multiple commits and PR to avoid
various changes in one PR. This will ease the review and Q/A process.
In this commit, I have done these tasks.

 1 - Delete all the SQL.in files because these version-dependent files
 are becoming significant in quantity. Now added a single SQL file for which
 contains the dynamic SQL based on the PostgreSQL Version.

 2 - New SQL files (pg_stat_monitor--2.0.sql) added for pg_stat_monitor version 2.

 3 - A new SQL file (pg_stat_monitor--1.0--2.0.sql) is created, which will be
 used to upgrade from version 1.0 to 2.0. Currently, this file is empty. But
 whenever we add some API changes into 2.0, we need to update that file too.

 4 - The control file (pg_stat_monitor.control) is updated for version 2.0.
 This change will make the CREATE EXTENSION default to pg_stat_monitor version 2.0
2022-10-24 17:21:59 +00:00
Ibrar Ahmed 20f3d8c047 PG-210: Columns names should match upstream pg_stat_statements column names. 2021-11-10 18:33:02 +00:00
Ibrar Ahmed a93ba37ac3 PG-246, PG-211, PG-147: Fix performance issue while querying the pg_stat_monitor.
This performance fix resolves two more issues (PG-211, PG-147).
2021-10-05 20:33:34 +00:00
Ibrar Ahmed 361c7d370a PG-211: Fix the issue while generating histogram. 2021-09-30 18:47:12 +00:00
Diego Fronza 775c087fb2 PG-222: Add benchmark support for measuring hook execution time.
Added a new view 'pg_stat_monitor_hook_stats' that provide execution
time statistics for all hooks installed by the module, following is a
description of the fields:
  -       hook: The hook function name.
  -   min_time: The fastest execution time recorded for the given hook.
  -   max_time: The slowest execution time recorded for the given hook.
  - total_time: Total execution time taken by all calls to the hook.
  -   avg_time: Average execution time of a call to the hook.
  -     ncalls: Total number of calls to the hook.
  - load_comparison: A percentual of time taken by an individual hook
                     compared to every other hook.

To enable benchmark, code must be compiled with -DBENCHMARK flag, this
will make the hook functions to be replaced by a function with the same
name plus a '_benchmark' suffix, e.g. hook_function_benchmark.

The hook_function_benchmark will call the original function and
calculate the amount of time it took to execute, than it will update
statistics for that hook.
2021-08-23 11:50:56 -04:00
Ibrar Ahmed 67b3d961ca PG-193: Comment based tags to identify different parameters. 2021-05-19 22:15:37 +05:00
Ibrar Ahmed f8ed33a92a PG-188: Added a new column to monitor the query state. 2021-03-21 00:04:39 +05:00
Ibrar Ahmed e0fc683810 PG-186: Add support to monitor query execution plan. 2021-03-17 18:56:39 +05:00
Ibrar Ahmed 066162c3f6 PG-186: Add support to monitor query execution plan.
This requires refactoring of code to add this functionality. Along with
that this patch contains regression test cases.
2021-03-12 18:55:12 +00:00
Ibrar Ahmed cabab69b76 PG-147: Store top query, instead of parent query. 2021-02-17 14:43:00 +00:00
Ibrar Ahmed ed6fe2d8dc PG-147 Stored Procedure Support add parentid to track caller.
Patch By: Martin Sun
Reviewed By: Hamid Akhtar
2021-02-12 11:42:36 +00:00
Ibrar Ahmed d60f725b4a PG-176 : Extract fully qualified relations name. 2021-02-11 15:51:44 +00:00
Ibrar Ahmed ce9d503cdb PG-175: Only Superuser / Privileged user can view IP address. 2021-02-11 12:41:21 +00:00
Ibrar Ahmed a6036b86ac PG-174: Code cleanup. 2021-02-11 12:02:04 +00:00
Ibrar Ahmed bd8c54476f PG-150: Logging CMD Type like SELECT, UPDATE, INSERT, DELETE. 2021-02-10 14:55:40 +00:00
Ibrar Ahmed 3f19640715 PG-172: Exponential histogram for time buckets. 2021-02-02 17:55:31 +00:00
Ibrar Ahmed 8410572ce3 PG-173: Added new WAL usage statistics. 2021-02-02 15:50:33 +00:00
Ibrar Ahmed 12ba1e39d1 PG-172: Exponential histogram for time buckets. 2021-02-02 15:30:28 +00:00
Ibrar Ahmed 10e0b4f0f6 PG-167: SQLERRCODE must be in readable format. 2021-01-19 12:35:52 +00:00
Ibrar Ahmed 412d9bc9b1 PG-166: Display actual system time instead of null. 2021-01-18 17:11:49 +00:00
Ibrar Ahmed 0e8f4c489c PG-165: Recycle expired buckets. 2021-01-14 12:58:42 +00:00
Ibrar Ahmed 51522ca6d9 PG-164: Query timing will be four decimal places instead of two. 2021-01-14 10:11:37 +00:00
Ibrar Ahmed a297ac19ea PG-161: Miscellaneous small issues. 2021-01-12 07:47:22 +00:00
Ibrar Ahmed 860de28e6f PG-159: Bucket start time (bucket_start_time) should be aligned with bucket_time. 2021-01-11 17:20:27 +00:00
Ibrar Ahmed 47ad105011 PG-150: Logging CMD Type like SELECT, UPDATE, INSERT, DELETE. 2020-12-06 16:38:48 +00:00
Ibrar Ahmed 6ec5c2b4ed PG-153: Log application name. 2020-11-24 21:03:32 +00:00
Ibrar Ahmed 057150c99b Issue - (#21): Show objects(tables) involved in the query.
PG-96
2020-11-24 20:10:49 +00:00
Ibrar Ahmed 5bea9f4581 Issue - (#62): Logging CMD Type like SELECT, UPDATE, INSERT, DELETE, UNKNOWN.
PG-150
2020-11-12 13:14:27 +00:00
Ibrar Ahmed 3999e28c00 Issue - (#61): Remove unnecessary code previously used for wait_events.
PG-146
2020-11-11 13:52:45 +00:00
Ibrar Ahmed 7b04755037 Issue - (#60): Log error/warning/info and debug messages.
PG-136
2020-11-11 11:47:06 +00:00
Ibrar Ahmed ec1ff594b4 Issue - (#54): Planning counters require renaming.
PG-144 : Changing planing counter name to sync with pg_stat_statment.
2020-10-12 22:39:44 +00:00
Ibrar Ahmed b23df84af9 Issue - (#52): Create a function to return the build version.
Jira: PG-142
2020-10-12 17:54:44 +00:00
Ibrar Ahmed db01ed546b Issue (#48): Fix typos in the code.
Jira: PG-133
2020-10-08 18:47:49 +00:00
Ibrar Ahmed 935d063f13 Issue(30): Code refactoring. 2020-09-14 22:26:19 +00:00
Ibrar Ahmed 355436c4dc Issue - (#34): PostgreSQL Version 13 support added. 2020-06-23 17:24:21 +00:00
Ibrar Ahmed 5536041539 Issue - (#33): Display all the custom configuration parameters used for pg_stat_monitor.
A new view named (pg_stat_monitor_settings) is added to see all the custom
configuration parameters and its default, min, max, and type.
2020-05-25 11:58:22 +00:00
Ibrar Ahmed c9de79b6ba Issue (#29) - Fix regression test, broken by latest fixes. 2020-04-14 13:04:21 +00:00
Ibrar Ahmed a2b9726f81 Issue (#28): Fix missing query issue.
There was a problem in the SQL file to query the wait events.
2020-04-14 12:33:37 +00:00
Ibrar Ahmed fca8cd431a Issue - (#27): PG-106: Support for WaitEvents, similar to pg_stat_activity added. 2020-03-20 05:17:10 +00:00
Ibrar Ahmed 179e99d692 Major refactoring to support multiple new features.
Issue - (#16): PG-112: Change the column name "ip" to "client_ip" for readability purpose.
Issue - (#17): PG-111: Show all the queries from complete and incomplete buckets.
Issue - (#18): PG-108: Log the bucket start time.
Issue - (#19): PG-99: Response time histogram.
Issue - (#20): PG-97: Log CPU time for a query.
Issue - (#21): PG-96: Show objects(tables) involved in the query.
Issue - (#22): PG-93: Retain the bucket, and don't delete the bucket automatically.
Issue - (#23): PG-91: Log queries of all the databases.
Issue - (#24): PG-116: Restrict the query size.
Issue - (#3) : README file update.
2020-02-27 19:27:05 +00:00
Ibrar Ahmed 7a0023688b Issue - (#8):  Fixing the problem when accessing pg_stat_monitor host column.
When accessing the "host" column, it gives the error in some cases
"ERROR:  result is out of range". The patch changes the host datatype
from int to bigint.
2019-12-03 08:44:27 +00:00
Ibrar Ahmed 3857313837 Issue - (#3): README file update. 2019-11-21 18:30:49 +00:00
Ibrar Ahmed 56d8375c38 Issue - (#2): Extended pg_stat_statement to provide new features.
Support for database/user/client based aggregates added to access
these statistics with three new views added. Some new counters added
including min/max/mean's time histograms. We are saving the parameters
of the slow queries, which can be tested later. Did some refactoring
of the code, by renaming the whole extension from pg_stat_statement to
pg_stat_monitor.
2019-11-20 10:30:57 +00:00