Skip to main content

Check and analyze a PostgreSQL cluster.

Project description

InsidePostgreSQL Package

This Python package provides functionality to interact with a PostgreSQL database and perform various checks and calculations. It includes the following features:

  • Connection to a PostgreSQL database
  • Checking for inactive replication slots
  • Checking for long-running queries
  • Counting active sessions
  • Calculating table bloat ratio
  • Checking the last analyze and autovacuum dates for tables
  • Checking node and postgresql exporter endpoints
  • Checking average lock count on database

Getting Started

pip3 install insidepostgresql
import postgresql
db = postgresql.PostgreSQL("172.17.0.2", "demo", "test123", "test")
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| Issue                                    | Result   | Description                                                                                        |
+==========================================+==========+====================================================================================================+
| Connected To PostgreSQL                  | ✓        | PostgreSQL connection test.                                                                        |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| Long Running Query                       | ✓        | There is no running query older than 1 minute                                                      |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| Sum of Active Sessions < 50              | ✓        | Active session count is less than 50                                                               |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| Average Important Lock Count < 10        | ✓        | Average of RowExclusiveLock,ShareUpdateExclusiveLock,ShareLock,AccessExclusiveLock is less than 10 |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| Last Analyze/Autovacuum in the Last Week | ✓        | All tables are maintained this week.                                                               |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| No Bloat Table Exists                    | ✓        | There is no table with bloat ratio greater than 50                                                 |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| No Inactive Replication Slot             | ✓        | All replication slots are working and active.                                                      |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| Node Exporter Working                    | ✗        | Node exporter are working and running                                                              |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+
| PostgreSQL Exporter Working              | ✗        | PostgreSQL exporter are working and running                                                        |
+------------------------------------------+----------+----------------------------------------------------------------------------------------------------+

Contributing

If you would like to contribute to insidepostgresql, please submit a pull request with your changes. Before submitting a pull request, please make sure that your changes are properly tested and documented.

License

InsideCouchbase is licensed under the MIT license. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insidepostgresql-0.0.3.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

insidepostgresql-0.0.3-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file insidepostgresql-0.0.3.tar.gz.

File metadata

  • Download URL: insidepostgresql-0.0.3.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for insidepostgresql-0.0.3.tar.gz
Algorithm Hash digest
SHA256 72668d7023ac1e9b44b3cac62763a0f6d4ae3f668d0d6cec452ff9fecaa6e285
MD5 6f112a1c2be9719df7b166229498eeab
BLAKE2b-256 ca64948e583a3d94b681e998a3824b0d7eeea348c63c05b39d2470513ff2e269

See more details on using hashes here.

File details

Details for the file insidepostgresql-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for insidepostgresql-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4b5bcd34d5ff8c2fc76e1d744d368bda5ebf3440d4dadfe57c849a627c39a710
MD5 54916acfceffa524e2d1c071557dee8f
BLAKE2b-256 e103e816fc95fb965f0a74decbeb2282a80b97a01a1ef0cb0d56a2d11161c351

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page