{"repo":"AmbitionEng/django-pgactivity","free":true,"listed":false,"github":"https://github.com/AmbitionEng/django-pgactivity","clone":"git clone https://github.com/AmbitionEng/django-pgactivity.git","description":"View, filter, and kill Postgres queries.","language":"Python","stars":46,"topics":["django","postgresql"],"license":"BSD-3-Clause","category":"databases-storage","readme_excerpt":"django-pgactivity django-pgactivity makes it easy to view, filter, and kill active Postgres queries. Some of the features at a glance: The PGActivity proxy model and pgactivity management command for querying and filtering the Postgres pg stat activity view. pgactivity.context and pgactivity.middleware.ActivityMiddleware for annotating queries with application metadata, such as the request URL. pgactivity.cancel and pgactivity.terminate for canceling and terminating queries. The PGActivity model manager also has these methods. pgactivity.timeout for dynamically setting the statement timeout. Quick Start Basic Command Usage Use python manage.py pgactivity to view and filter active queries. Output looks like the following: 39225 0:01:32 IDLE IN TRANSACTION None lock auth user in access exclusiv 39299 0:00:15 ACTIVE None SELECT \"auth user\".\"id\", \"auth user\".\"password 39315 0:00:00 ACTIVE None WITH pgactivity activity cte AS ( SELECT pid The default output attributes are: 1. The process ID of the connection. 2. The duration of the query. 3. The state of the query (see the Postgres docs for values). 4. Attached context using pgactivity.context . 5. The query SQL. Apply filters with -f (or --filter ). Here we query for all active queries that have a duration longer than a minute: python manage.py pgactivity -f state=ACTIVE -f 'duration gt=1 minute' Cancel or terminate activity with --cancel or --terminate . Here we terminate a query based on the process ID: python manage.py pgactiv","default_branch":null,"files":null,"tree":[],"storefront":"/r/AmbitionEng","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/AmbitionEng/django-pgactivity/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}