aboutsummaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 201562521f7..e29397f25b8 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -696,6 +696,25 @@ typedef struct PgStat_GlobalStats
/* ----------
+ * Backend types
+ * ----------
+ */
+typedef enum BackendType
+{
+ B_AUTOVAC_LAUNCHER,
+ B_AUTOVAC_WORKER,
+ B_BACKEND,
+ B_BG_WORKER,
+ B_BG_WRITER,
+ B_CHECKPOINTER,
+ B_STARTUP,
+ B_WAL_RECEIVER,
+ B_WAL_SENDER,
+ B_WAL_WRITER
+} BackendType;
+
+
+/* ----------
* Backend states
* ----------
*/
@@ -927,6 +946,9 @@ typedef struct PgBackendSSLStatus
* showing its current activity. (The structs are allocated according to
* BackendId, but that is not critical.) Note that the collector process
* has no involvement in, or even access to, these structs.
+ *
+ * Each auxiliary process also maintains a PgBackendStatus struct in shared
+ * memory.
* ----------
*/
typedef struct PgBackendStatus
@@ -951,6 +973,9 @@ typedef struct PgBackendStatus
/* The entry is valid iff st_procpid > 0, unused if st_procpid == 0 */
int st_procpid;
+ /* Type of backends */
+ BackendType st_backendType;
+
/* Times when current backend, transaction, and activity started */
TimestampTz st_proc_start_timestamp;
TimestampTz st_xact_start_timestamp;
@@ -1149,6 +1174,7 @@ extern const char *pgstat_get_wait_event_type(uint32 wait_event_info);
extern const char *pgstat_get_backend_current_activity(int pid, bool checkUser);
extern const char *pgstat_get_crashed_backend_activity(int pid, char *buffer,
int buflen);
+extern const char *pgstat_get_backend_desc(BackendType backendType);
extern void pgstat_progress_start_command(ProgressCommandType cmdtype,
Oid relid);