Commit Graph

41 Commits (3653dd604174bfdc67d832feea0e5c2d2a7b65cc)

Author SHA1 Message Date
Artem Gavrilov 3bb65798fd
Format sources (#475)
* Temporary disable workflows

* Add indent target to makefiel

* Add CI workflow to check if sources formatted

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Format sources

* Add comments

* Revert "Temporary disable workflows"

This reverts commit 7e11cf6154.

* Revert "Format sources"

This reverts commit 6ef992d9f0.

* Use PG17 for code formatt

* Format sources

* Revert "Format sources"

This reverts commit 34061e1f82.

* Format sources
2024-08-07 15:12:24 +02:00
Artem Gavrilov d7999f1acf
[PG-644] Add option to disable application name tracking (#469)
* Cache application name for every backed instance

* Improve pg_get_backend_status performance for PG16 and PG17

* Fix

* Make application_name tracking disabled by default

* Meke app name tracking opt-out

* Format newly added code with pgindent

* Fix build for PG17

* Fix
2024-07-23 18:49:33 +02:00
Artem Gavrilov 288ec6325f
Add license headers validation (#458)
* Add .licenserc.yaml file

* Fix license headers

* Add github action to check license headers

* Fix workflow

* Fix checkout path

* Rename workflow

* Add debug info

* Disable workflows

* Try fix

* Split check workflow in two jobs

* Try invalid license header

* Comment of failure

* Disable cppcheck job

* Fix licenserc file

* Enable debug logging

* Prevent comments from licence-eye

* Revert "Disable cppcheck job"

This reverts commit 10f55373ea.

* Revert "Disable workflows"

This reverts commit 2e2ead2fa5.

* Fix typo

* Revert "Try invalid license header"

This reverts commit 0cc0c883d2.

* Update year in license headers

* Cleanup

* Fix indention in license header
2024-04-26 10:55:50 +02:00
Hamid Akhtar 9cf2fb8d56 PostgreSQL 16 support for PGSM
* Fixing issues with GUC initialization and function renames
    * Fixed regression issues with PG16
2023-09-12 12:45:58 +05:00
Hamid Akhtar 9ecd2ccbb7 Updating formatting of source code 2023-03-01 19:40:24 +05:00
Hamid Akhtar faa938b8f1 Fixing code indentation with pgindent 2023-02-27 14:47:27 +05:00
Muhammad Usama fe23d31bf9
PG-607: Allow histogram to track queries in sub-ms time brackets (#384)
* PG-607: Allow histogram to track queries in sub-ms time brackets

Updated the GUC configuration and the relevant histogram functionality
to track queries in lower cardinality than ms. This is done by saving
the GUC values for histogram min and max values in real (double) type.

All test cases except for the 030 tap test are passing. The test case
needs an update.

* Fixing regression issues for v12 and below because of histogram changes.
2023-02-23 21:24:40 +05:00
Muhammad Usama 05ffcac2fa
PG-606: New GUC required for enabling/disabling of pgsm_query_id calculation… (#383)
* PG-606: New GUC required for enabling/disabling of pgsm_query_id calculation

Adds a new GUC pg_stat_monitor.pgsm_enable_pgsm_query_id to enable/disable
pgsm query id calculation. Apart from that patch also refactors the GUC-related
code to match PostgreSQL conventions.

Moreover, the commit also changes the pgsm_enable_overflow GUC to boolean
instead of enum.
2023-02-23 19:08:09 +05:00
Hamid Akhtar de66ef0fce PG-588: Some queries are not being normalised.
This bug uncovered serious issues with how the data was being stored by PSGM.
So it require a complete redesign.

pg_stat_monitor now stores the data locally within the backend process's local
memory. The data is only stored when the query completes. This reduces the
number of lock acquisitions that were previously needed during various stages
of the execution. Also, this avoids data loss in case the current bucket
changes during execution. Also, the unavailability of jumble state during later
stages of executions was causing pg_stat_monitor to save non-normalized query.
This was a major problem as well.

pg_stat_monitor specific memory context is implemented. It is used for saving
data locally. The context memory callback helps us clear the locally saved data
so that we do not store it multiple times in the shared hash.

As part of this major rewrite, pgss reference in function and variable names
is changed to pgsm. Memory footprint for the entries is reduced, data types
are corrected where needed, and we've removed unused variables, functions and
macros.

This patch was mutually created by:
Co-authored-by: Hamid Akhtar <hamid.akhtar@percona.com>
Co-authored-by: Muhammad Usama <muhammad.usama@percona.com>
2023-02-22 19:31:52 +05:00
Hamid Akhtar 209f370cef PG-562: Histogram Ranges/Buckets are not correct.
Added buckets for queries that take less than minimum histogram time
and one for the ones taking more than the max value specified.

Also, in case the buckets end up overlapping, on server start, an
error will be thrown informing the user of this issue and requesting
a rectification.

Refactored the code to consolidate the calculations in a single
function.
2023-01-23 12:37:51 +05:00
Ibrar Ahmed 354b92b8b6 PG-312: Changing the default value of Histogram GUC. 2022-11-23 14:49:21 +00:00
Ibrar Ahmed a9187117f9
PG-456: Running pgindent to make source PostgreSQL compatible. (#269)
PG-456: Running pgindent to make source indentation/spacing PostgreSQLCompatible.

PostgreSQL uses pgindent from time to time to make source code PostgreSQL
style guide compatible, it is a very long time since we have not done that.
Commit fixes a lot of indentation and spacing issues.

Co-authored-by: Hamid Akhtar <hamid.akhtar@gmail.com>
2022-06-29 00:42:40 +05:00
Hamid Akhtar cd06be62fd [PG-436] Merging REL_1_STABLE on to the main branch.
Merge remote-tracking branch 'origin/REL_1_STABLE'
2022-06-19 13:42:10 +05:00
Ibrar Ahmed d5ce83738f
PG-362: pgsm_normalized_query needs to be 0 by default. (#253)
pg_stat_monitor.pgsm_normalized_query needs to be 0 by default because
people will get Query examples. This is one of the main user-faced
advantages of pgsm over pgss (pg_stat_statements).
2022-06-09 16:13:58 +05:00
Ibrar Ahmed 4bf7b80c8a
Merge pull request #221 from ibrarahmad/PG-382
PG-382: Adjust the maximum value for histogram buckets.
2022-05-26 21:39:07 +05:00
Ibrar Ahmed 13eedd579e PG-382: Adjust the maximum value for histogram buckets.
There was no maximum limit set for the number of maximum histograms
bucket, which can lead to a crash in case of higher value.

PG-382: Adjust the maximum value for histogram buckets.

Fix the regression issue related to GUC and set the maximum
buckets value correctly.

PG-382: Adjust the maximum value for histogram buckets.

Fix the TAP test cases.
2022-05-24 17:50:07 +00:00
Ibrar Ahmed f60d3422df PG-382: Adjust the maximum value for histogram buckets.
There was no maximum limit set for the number of maximum histograms
bucket, which can lead to a crash in case of higher value.

PG-382: Adjust the maximum value for histogram buckets.

Fix the regression issue for PostgreSQL-12.

PG-382: Adjust the maximum value for histogram buckets.

Fix the TAP test cases.
2022-05-24 17:15:03 +00:00
Francisco Miguel Biete 1596208b64
Support C11 2022-05-13 09:47:13 +01:00
Ibrar Ahmed 34e14104d7
PG-338: Calls count is not correct in PG-13.; PG-331: Default values for better presentation in PMM (#191)
* PG-338: Calls count is not correct in PG-13.
* PG-331: Defaults values for better presentation in PMM.
* Update pg_stat_monitor.c

Co-authored-by: Lenz Grimmer <lenz.grimmer@percona.com>
Co-authored-by: Hamid Akhtar <hamid.akhtar@gmail.com>
Co-authored-by: Ibrar Ahmad <ibrar.ahmad@gmail.com>
2022-03-21 17:53:59 +05:00
Ibrar Ahmed 153f8d2e87 PG-338: Calls count is not correct in PG-13.
cherry-pick patch (b6838049b6) by Diego
and I did some refatoring.
2022-03-14 18:14:11 +00:00
Diego Fronza 5528bef82d PG-326: Validate histogram_min and histogram_max ranges.
Added hook for checking histogram min and max values, in order to ensure
that histogram_min is always less than histogram_max.
2022-03-01 13:13:41 +05:00
Naeem Akhter 2e31738f15 PG-195: Change pgsm_bucket_time value from 300 to 60.
Changed the default value of pgsm_bucket_time from 300 to 60. Now neither PMM users will need to adjust the default value, nor
restart of PG server will be required for this purpose.
2021-08-17 18:23:15 +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 6aa1b2e7b6 PG-182: Added a new option for the query buffer overflow. 2021-02-17 13:08:39 +00:00
Ibrar Ahmed a222adc587 PG-178: Test cases fixes. 2021-02-15 13:08:08 +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 a6036b86ac PG-174: Code cleanup. 2021-02-11 12:02:04 +00:00
Ibrar Ahmed 12ba1e39d1 PG-172: Exponential histogram for time buckets. 2021-02-02 15:30:28 +00:00
Ibrar Ahmed 9bee6b3690 Copyright Notice update. 2021-01-05 18:56:07 +00:00
Ibrar Ahmed bedc2ffc78 PG-154: Add backup option in case of no space left in the bucket. 2020-11-29 20:11:23 +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 8918017134 Issue (#59): Build failed using gcc-9 and 10.
The issue only occurs when compiled using -fno-common flag.
2020-11-02 11:21:47 +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 73ceecbde3 Issue - (#43): Minor typos.
PG-123
2020-08-17 15:07:15 +00:00
Ibrar Ahmed 6700c9686e Issue (#42): Enable/Disable pg_stat_monitor should not require PostgreSQL restart.
PG-124
2020-08-17 15:01:32 +00:00
Ibrar Ahmed a2c87d8398 Issue - (#40): Cannot set pgsm_track value with psql client with alter system.
Removed the track option and added a new option pgsm_enable, which require a restart.

PG-122
2020-08-06 10:43:27 +00:00
Ibrar Ahmed beeb960e82 Issue - (#38),(#39): GUC variable validation does not work properly.
PG-120, PG121
2020-07-30 09:28:30 +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 beca034067 Issue (#30) - Code refactoring. 2020-04-15 09:49:02 +00:00