Skip to main content

ActivityRow

Struct ActivityRow 

Source
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: String

v7.39 (round 319, V52) — the peer’s IP, empty when the connection has no TCP peer (PG reports NULL there).

§client_port: i32

v7.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: String

v7.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: String

v7.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: String

v7.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: String

v7.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

Source

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

Source§

fn clone(&self) -> ActivityRow

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActivityRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.