mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Cosmetic fixups for WAL usage work.
Reported-by: Justin Pryzby and Euler Taveira Author: Justin Pryzby and Julien Rouhaud Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/CAB-hujrP8ZfUkvL5OYETipQwA=e3n7oqHFU=4ZLxWS_Cza3kQQ@mail.gmail.com
This commit is contained in:
@ -43,7 +43,7 @@ CREATE FUNCTION pg_stat_statements(IN showtext boolean,
|
||||
OUT blk_read_time float8,
|
||||
OUT blk_write_time float8,
|
||||
OUT wal_records int8,
|
||||
OUT wal_num_fpw int8,
|
||||
OUT wal_fpw int8,
|
||||
OUT wal_bytes numeric
|
||||
)
|
||||
RETURNS SETOF record
|
||||
|
@ -189,7 +189,7 @@ typedef struct Counters
|
||||
double blk_write_time; /* time spent writing, in msec */
|
||||
double usage; /* usage factor */
|
||||
int64 wal_records; /* # of WAL records generated */
|
||||
int64 wal_num_fpw; /* # of WAL full page image records generated */
|
||||
int64 wal_fpw; /* # of WAL full page writes generated */
|
||||
uint64 wal_bytes; /* total amount of WAL bytes generated */
|
||||
} Counters;
|
||||
|
||||
@ -1432,7 +1432,7 @@ pgss_store(const char *query, uint64 queryId,
|
||||
e->counters.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time);
|
||||
e->counters.usage += USAGE_EXEC(total_time);
|
||||
e->counters.wal_records += walusage->wal_records;
|
||||
e->counters.wal_num_fpw += walusage->wal_num_fpw;
|
||||
e->counters.wal_fpw += walusage->wal_fpw;
|
||||
e->counters.wal_bytes += walusage->wal_bytes;
|
||||
|
||||
SpinLockRelease(&e->mutex);
|
||||
@ -1824,7 +1824,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
|
||||
Datum wal_bytes;
|
||||
|
||||
values[i++] = Int64GetDatumFast(tmp.wal_records);
|
||||
values[i++] = Int64GetDatumFast(tmp.wal_num_fpw);
|
||||
values[i++] = Int64GetDatumFast(tmp.wal_fpw);
|
||||
|
||||
snprintf(buf, sizeof buf, UINT64_FORMAT, tmp.wal_bytes);
|
||||
|
||||
|
Reference in New Issue
Block a user