1
0
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:
Amit Kapila
2020-04-13 15:31:16 +05:30
parent 0c620a5803
commit ef08ca113f
9 changed files with 18 additions and 18 deletions

View File

@ -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

View File

@ -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);