Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cc96373

Browse files
committed
pgstat: rename some pgstat_send_* functions to pgstat_report_*.
Only the pgstat_send_* functions that are called from outside pgstat*.c are renamed (the rest will go away). This is done separately from the - quite large - shared memory statistics patch to make review easier. Author: Andres Freund <andres@anarazel.de> Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/20220404041516.cctrvpadhuriawlq@alap3.anarazel.de
1 parent dbafe12 commit cc96373

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

src/backend/postmaster/bgwriter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ BackgroundWriterMain(void)
241241
can_hibernate = BgBufferSync(&wb_context);
242242

243243
/* Report pending statistics to the cumulative stats system */
244-
pgstat_send_bgwriter();
244+
pgstat_report_bgwriter();
245245

246246
if (FirstCallSinceLastCheckpoint())
247247
{

src/backend/postmaster/checkpointer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ CheckpointerMain(void)
493493
CheckArchiveTimeout();
494494

495495
/* Report pending statistics to the cumulative stats system */
496-
pgstat_send_checkpointer();
497-
pgstat_send_wal(true);
496+
pgstat_report_checkpointer();
497+
pgstat_report_wal(true);
498498

499499
/*
500500
* If any checkpoint flags have been set, redo the loop to handle the
@@ -571,8 +571,8 @@ HandleCheckpointerInterrupts(void)
571571
*/
572572
PendingCheckpointerStats.m_requested_checkpoints++;
573573
ShutdownXLOG(0, 0);
574-
pgstat_send_checkpointer();
575-
pgstat_send_wal(true);
574+
pgstat_report_checkpointer();
575+
pgstat_report_wal(true);
576576

577577
/* Normal exit from the checkpointer is here */
578578
proc_exit(0); /* done */
@@ -715,7 +715,7 @@ CheckpointWriteDelay(int flags, double progress)
715715
CheckArchiveTimeout();
716716

717717
/* Report interim statistics to the cumulative stats system */
718-
pgstat_send_checkpointer();
718+
pgstat_report_checkpointer();
719719

720720
/*
721721
* This sleep used to be connected to bgwriter_delay, typically 200ms.

src/backend/postmaster/pgarch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ pgarch_ArchiverCopyLoop(void)
480480
* Tell the cumulative stats system about the WAL file that we
481481
* successfully archived
482482
*/
483-
pgstat_send_archiver(xlog, false);
483+
pgstat_report_archiver(xlog, false);
484484

485485
break; /* out of inner retry loop */
486486
}
@@ -490,7 +490,7 @@ pgarch_ArchiverCopyLoop(void)
490490
* Tell the cumulative stats system about the WAL file that we
491491
* failed to archive
492492
*/
493-
pgstat_send_archiver(xlog, true);
493+
pgstat_report_archiver(xlog, true);
494494

495495
if (++failures >= NUM_ARCHIVE_RETRIES)
496496
{

src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ pgstat_report_stat(bool disconnect)
793793
pgstat_send_funcstats();
794794

795795
/* Send WAL statistics */
796-
pgstat_send_wal(true);
796+
pgstat_report_wal(true);
797797

798798
/* Finally send SLRU statistics */
799799
pgstat_send_slru();

src/backend/postmaster/walwriter.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ WalWriterMain(void)
258258
left_till_hibernate--;
259259

260260
/* report pending statistics to the cumulative stats system */
261-
pgstat_send_wal(false);
261+
pgstat_report_wal(false);
262262

263263
/*
264264
* Sleep until we are signaled or WalWriterDelay has elapsed. If we
@@ -297,11 +297,11 @@ HandleWalWriterInterrupts(void)
297297
/*
298298
* Force reporting remaining WAL statistics at process exit.
299299
*
300-
* Since pgstat_send_wal is invoked with 'force' is false in main loop
300+
* Since pgstat_report_wal is invoked with 'force' is false in main loop
301301
* to avoid overloading the cumulative stats system, there may exist
302302
* unreported stats counters for the WAL writer.
303303
*/
304-
pgstat_send_wal(true);
304+
pgstat_report_wal(true);
305305

306306
proc_exit(0);
307307
}

src/backend/utils/activity/pgstat_archiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* Report archiver statistics
2626
*/
2727
void
28-
pgstat_send_archiver(const char *xlog, bool failed)
28+
pgstat_report_archiver(const char *xlog, bool failed)
2929
{
3030
PgStat_MsgArchiver msg;
3131

src/backend/utils/activity/pgstat_bgwriter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PgStat_MsgBgWriter PendingBgWriterStats;
3232
* Report bgwriter statistics
3333
*/
3434
void
35-
pgstat_send_bgwriter(void)
35+
pgstat_report_bgwriter(void)
3636
{
3737
/* We assume this initializes to zeroes */
3838
static const PgStat_MsgBgWriter all_zeroes;

src/backend/utils/activity/pgstat_checkpointer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PgStat_MsgCheckpointer PendingCheckpointerStats;
3232
* Report checkpointer statistics
3333
*/
3434
void
35-
pgstat_send_checkpointer(void)
35+
pgstat_report_checkpointer(void)
3636
{
3737
/* We assume this initializes to zeroes */
3838
static const PgStat_MsgCheckpointer all_zeroes;

src/backend/utils/activity/pgstat_wal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ PgStat_MsgWal WalStats;
3131

3232
/*
3333
* WAL usage counters saved from pgWALUsage at the previous call to
34-
* pgstat_send_wal(). This is used to calculate how much WAL usage
35-
* happens between pgstat_send_wal() calls, by subtracting
34+
* pgstat_report_wal(). This is used to calculate how much WAL usage
35+
* happens between pgstat_report_wal() calls, by subtracting
3636
* the previous counters from the current ones.
3737
*/
3838
static WalUsage prevWalUsage;
@@ -45,7 +45,7 @@ static WalUsage prevWalUsage;
4545
* passed since last one was sent to reach PGSTAT_STAT_INTERVAL.
4646
*/
4747
void
48-
pgstat_send_wal(bool force)
48+
pgstat_report_wal(bool force)
4949
{
5050
static TimestampTz sendTime = 0;
5151

@@ -133,7 +133,7 @@ void
133133
pgstat_wal_initialize(void)
134134
{
135135
/*
136-
* Initialize prevWalUsage with pgWalUsage so that pgstat_send_wal() can
136+
* Initialize prevWalUsage with pgWalUsage so that pgstat_report_wal() can
137137
* calculate how much pgWalUsage counters are increased by subtracting
138138
* prevWalUsage from pgWalUsage.
139139
*/

src/include/pgstat.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -997,21 +997,21 @@ extern PgStat_WalStats *pgstat_fetch_stat_wal(void);
997997
* Functions in pgstat_archiver.c
998998
*/
999999

1000-
extern void pgstat_send_archiver(const char *xlog, bool failed);
1000+
extern void pgstat_report_archiver(const char *xlog, bool failed);
10011001

10021002

10031003
/*
10041004
* Functions in pgstat_bgwriter.c
10051005
*/
10061006

1007-
extern void pgstat_send_bgwriter(void);
1007+
extern void pgstat_report_bgwriter(void);
10081008

10091009

10101010
/*
10111011
* Functions in pgstat_checkpointer.c
10121012
*/
10131013

1014-
extern void pgstat_send_checkpointer(void);
1014+
extern void pgstat_report_checkpointer(void);
10151015

10161016

10171017
/*
@@ -1165,7 +1165,7 @@ extern void PostPrepare_PgStat(void);
11651165
* Functions in pgstat_wal.c
11661166
*/
11671167

1168-
extern void pgstat_send_wal(bool force);
1168+
extern void pgstat_report_wal(bool force);
11691169

11701170

11711171
/*

0 commit comments

Comments
 (0)