mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
PG-310: Bucket is “Done” vs still being current/last. (#321)
A new column is added to mention that bucket is active or done. there is some timing based adjustment was required with that too. Co-authored-by: Hamid Akhtar <hamid.akhtar@percona.com>
This commit is contained in:
@@ -126,7 +126,7 @@ CREATE FUNCTION pg_stat_monitor_internal(
|
||||
OUT elevel int,
|
||||
OUT sqlcode TEXT,
|
||||
OUT message text,
|
||||
OUT bucket_start_time timestamp,
|
||||
OUT bucket_start_time timestamptz,
|
||||
|
||||
OUT calls int8, -- 16
|
||||
|
||||
@@ -165,7 +165,8 @@ CREATE FUNCTION pg_stat_monitor_internal(
|
||||
OUT wal_fpi int8,
|
||||
OUT wal_bytes numeric,
|
||||
OUT comments TEXT,
|
||||
OUT toplevel BOOLEAN
|
||||
OUT toplevel BOOLEAN,
|
||||
OUT bucket_done BOOLEAN
|
||||
)
|
||||
RETURNS SETOF record
|
||||
AS 'MODULE_PATHNAME', 'pg_stat_monitor_2_0'
|
||||
@@ -219,7 +220,8 @@ CREATE VIEW pg_stat_monitor AS SELECT
|
||||
cpu_sys_time,
|
||||
wal_records,
|
||||
wal_fpi,
|
||||
wal_bytes
|
||||
wal_bytes,
|
||||
bucket_done
|
||||
FROM pg_stat_monitor_internal(TRUE) p, pg_database d WHERE dbid = oid
|
||||
ORDER BY bucket_start_time;
|
||||
RETURN 0;
|
||||
@@ -276,6 +278,7 @@ CREATE VIEW pg_stat_monitor AS SELECT
|
||||
wal_records,
|
||||
wal_fpi,
|
||||
wal_bytes,
|
||||
bucket_done,
|
||||
-- PostgreSQL-13 Specific Coulumns
|
||||
plans_calls,
|
||||
total_plan_time,
|
||||
@@ -338,6 +341,7 @@ CREATE VIEW pg_stat_monitor AS SELECT
|
||||
wal_records,
|
||||
wal_fpi,
|
||||
wal_bytes,
|
||||
bucket_done,
|
||||
|
||||
plans_calls,
|
||||
total_plan_time,
|
||||
|
||||
Reference in New Issue
Block a user