From 93128b2b3cdc19b7aa199e3afbb5338c0a5317af Mon Sep 17 00:00:00 2001 From: Pete Matthews <102467456+Pete-J-Matthews@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:20:02 +0100 Subject: [PATCH] add `application_name` field to proxy model (#11) --- pgactivity/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pgactivity/models.py b/pgactivity/models.py index 5378e1c..eae54c0 100644 --- a/pgactivity/models.py +++ b/pgactivity/models.py @@ -49,6 +49,7 @@ def get_ctes(self): BOTH '_' FROM UPPER(REGEXP_REPLACE(wait_event, '([A-Z])','_\1', 'g')) ) AS wait_event, state_change, + application_name, client_addr::text, client_hostname, client_port @@ -201,6 +202,7 @@ class PGActivity(PGTable): LOGICAL_REPLICATION_LAUNCHER, LOGICAL_REPLICATION_WORKER, PARALLEL_WORKER, BACKGROUND_WRITER, CLIENT_BACKEND, CHECKPOINTER, ARCHIVER, STARTUP, WALRECEIVER, WALSENDER, or WALWRITER. + application_name (models.CharField): Name of the application that is connected to this backend. client_addr (models.CharField): IP address of the client connected to this backend, if any. client_hostname (models.CharField): Host name of the connected client, as reported by a reverse DNS lookup of client_addr. @@ -221,6 +223,7 @@ class PGActivity(PGTable): backend_xid = models.CharField(max_length=256, null=True) backend_xmin = models.CharField(max_length=256, null=True) backend_type = models.CharField(max_length=64) + application_name = models.CharField(max_length=64, null=True) client_addr = models.CharField(max_length=256, null=True) client_hostname = models.CharField(max_length=256, null=True) client_port = models.IntegerField()