pub struct ActivityRow {Show 13 fields
pub pid: u32,
pub user: String,
pub client_addr: String,
pub client_port: i32,
pub database: String,
pub started_at_us: i64,
pub current_sql: String,
pub wait_event_type: String,
pub wait_event: String,
pub elapsed_us: i64,
pub in_transaction: bool,
pub application_name: String,
pub backend_type: String,
}Expand description
v6.5.2 — one row of spg_stat_activity. Engine-public so
spg-server can construct rows without re-exporting internal
dispatch types.
Fields§
§pid: u32§user: String§client_addr: Stringv7.39 (round 319, V52) — the peer’s IP, empty when the connection has no TCP peer (PG reports NULL there).
client_port: i32v7.39 (round 319, V52) — the peer’s port. PG reports -1, not NULL, for a connection with no TCP port; measured on PG 18.4.
database: Stringv7.39 (round 319, V52) — the database this connection named. Empty
when it named none; both pg_stat_activity.datname and
SHOW PROCESSLIST.db report that as NULL.
started_at_us: i64§current_sql: String§wait_event_type: Stringv7.37.14 (B6.3) — PG-style wait-event categorisation
(“Lock”, “LWLock”, “IPC”, “IO”, “Timeout”, “Client”,
“BufferPin”, “Extension”, “”). Empty string means idle.
Pair with wait_event to identify “what specifically is
the backend waiting on” the same way PG does.
wait_event: String§elapsed_us: i64§in_transaction: bool§application_name: Stringv7.17 Phase 2.4 — startup-param application_name (or the
last value the client sent via SET application_name = '...').
Empty when the client never declared one.
backend_type: Stringv7.39 (round 474) — PG’s backend_type: client backend for a
connection, or the worker’s own name for a background process.
pg_stat_activity used to hardcode client backend, so SPG’s own
background workers — the ones that hold the engine write lock and
are exactly what an operator is looking for when a statement
stalls — did not appear at all. PG18 lists eight of them beside
the single client backend on an idle server.
Implementations§
Source§impl ActivityRow
impl ActivityRow
Sourcepub fn background(pid: u32, backend_type: &str) -> Self
pub fn background(pid: u32, backend_type: &str) -> Self
The backend_type PG gives a background process: no database, no
user, no query, and a state PG reports as NULL.
Trait Implementations§
Source§impl Clone for ActivityRow
impl Clone for ActivityRow
Source§fn clone(&self) -> ActivityRow
fn clone(&self) -> ActivityRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more