From 5127a1da779c097b727c403b5e3764e8169aff37 Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sun, 3 Apr 2022 13:22:11 -0700
Subject: [PATCH v68 12/31] pgstat: rename some pgstat_send_* functions to
 pgstat_report_*.

Author:
Reviewed-By:
Discussion: https://postgr.es/m/
Backpatch:
---
 src/include/pgstat.h                             |  8 ++++----
 src/backend/postmaster/bgwriter.c                |  2 +-
 src/backend/postmaster/checkpointer.c            | 10 +++++-----
 src/backend/postmaster/pgarch.c                  |  4 ++--
 src/backend/postmaster/pgstat.c                  |  2 +-
 src/backend/postmaster/walwriter.c               |  6 +++---
 src/backend/utils/activity/pgstat_archiver.c     |  2 +-
 src/backend/utils/activity/pgstat_bgwriter.c     |  2 +-
 src/backend/utils/activity/pgstat_checkpointer.c |  2 +-
 src/backend/utils/activity/pgstat_wal.c          |  8 ++++----
 10 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 7d8cea48efa..26dde96726f 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -1018,21 +1018,21 @@ extern PgStat_WalStats *pgstat_fetch_stat_wal(void);
  * Functions in pgstat_archiver.c
  */
 
-extern void pgstat_send_archiver(const char *xlog, bool failed);
+extern void pgstat_report_archiver(const char *xlog, bool failed);
 
 
 /*
  * Functions in pgstat_bgwriter.c
  */
 
-extern void pgstat_send_bgwriter(void);
+extern void pgstat_report_bgwriter(void);
 
 
 /*
  * Functions in pgstat_checkpointer.c
  */
 
-extern void pgstat_send_checkpointer(void);
+extern void pgstat_report_checkpointer(void);
 
 
 /*
@@ -1187,7 +1187,7 @@ extern void pgstat_drop_subscription(Oid subid);
  * Functions in pgstat_wal.c
  */
 
-extern void pgstat_send_wal(bool force);
+extern void pgstat_report_wal(bool force);
 
 
 /*
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index 447596b2a8b..91e6f6ea18a 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -241,7 +241,7 @@ BackgroundWriterMain(void)
 		can_hibernate = BgBufferSync(&wb_context);
 
 		/* Report pending statistics to the cumulative stats system */
-		pgstat_send_bgwriter();
+		pgstat_report_bgwriter();
 
 		if (FirstCallSinceLastCheckpoint())
 		{
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 80914aa891c..e733c70368a 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -493,8 +493,8 @@ CheckpointerMain(void)
 		CheckArchiveTimeout();
 
 		/* Report pending statistics to the cumulative stats system */
-		pgstat_send_checkpointer();
-		pgstat_send_wal(true);
+		pgstat_report_checkpointer();
+		pgstat_report_wal(true);
 
 		/*
 		 * If any checkpoint flags have been set, redo the loop to handle the
@@ -571,8 +571,8 @@ HandleCheckpointerInterrupts(void)
 		 */
 		PendingCheckpointerStats.m_requested_checkpoints++;
 		ShutdownXLOG(0, 0);
-		pgstat_send_checkpointer();
-		pgstat_send_wal(true);
+		pgstat_report_checkpointer();
+		pgstat_report_wal(true);
 
 		/* Normal exit from the checkpointer is here */
 		proc_exit(0);			/* done */
@@ -715,7 +715,7 @@ CheckpointWriteDelay(int flags, double progress)
 		CheckArchiveTimeout();
 
 		/* Report interim statistics to the cumulative stats system */
-		pgstat_send_checkpointer();
+		pgstat_report_checkpointer();
 
 		/*
 		 * This sleep used to be connected to bgwriter_delay, typically 200ms.
diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c
index adfa404f464..0c8ca29f73d 100644
--- a/src/backend/postmaster/pgarch.c
+++ b/src/backend/postmaster/pgarch.c
@@ -480,7 +480,7 @@ pgarch_ArchiverCopyLoop(void)
 				 * Tell the cumulative stats system about the WAL file that we
 				 * successfully archived
 				 */
-				pgstat_send_archiver(xlog, false);
+				pgstat_report_archiver(xlog, false);
 
 				break;			/* out of inner retry loop */
 			}
@@ -490,7 +490,7 @@ pgarch_ArchiverCopyLoop(void)
 				 * Tell the cumulative stats system about the WAL file that we
 				 * failed to archive
 				 */
-				pgstat_send_archiver(xlog, true);
+				pgstat_report_archiver(xlog, true);
 
 				if (++failures >= NUM_ARCHIVE_RETRIES)
 				{
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 2ce4ffd2b64..6f985145b49 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -793,7 +793,7 @@ pgstat_report_stat(bool disconnect)
 	pgstat_send_funcstats();
 
 	/* Send WAL statistics */
-	pgstat_send_wal(true);
+	pgstat_report_wal(true);
 
 	/* Finally send SLRU statistics */
 	pgstat_send_slru();
diff --git a/src/backend/postmaster/walwriter.c b/src/backend/postmaster/walwriter.c
index e2c7eb78d69..77aebb244cb 100644
--- a/src/backend/postmaster/walwriter.c
+++ b/src/backend/postmaster/walwriter.c
@@ -258,7 +258,7 @@ WalWriterMain(void)
 			left_till_hibernate--;
 
 		/* report pending statistics to the cumulative stats system */
-		pgstat_send_wal(false);
+		pgstat_report_wal(false);
 
 		/*
 		 * Sleep until we are signaled or WalWriterDelay has elapsed.  If we
@@ -297,11 +297,11 @@ HandleWalWriterInterrupts(void)
 		/*
 		 * Force reporting remaining WAL statistics at process exit.
 		 *
-		 * Since pgstat_send_wal is invoked with 'force' is false in main loop
+		 * Since pgstat_report_wal is invoked with 'force' is false in main loop
 		 * to avoid overloading the cumulative stats system, there may exist
 		 * unreported stats counters for the WAL writer.
 		 */
-		pgstat_send_wal(true);
+		pgstat_report_wal(true);
 
 		proc_exit(0);
 	}
diff --git a/src/backend/utils/activity/pgstat_archiver.c b/src/backend/utils/activity/pgstat_archiver.c
index c829b91b60c..09bc12070da 100644
--- a/src/backend/utils/activity/pgstat_archiver.c
+++ b/src/backend/utils/activity/pgstat_archiver.c
@@ -25,7 +25,7 @@
  * Report archiver statistics
  */
 void
-pgstat_send_archiver(const char *xlog, bool failed)
+pgstat_report_archiver(const char *xlog, bool failed)
 {
 	PgStat_MsgArchiver msg;
 
diff --git a/src/backend/utils/activity/pgstat_bgwriter.c b/src/backend/utils/activity/pgstat_bgwriter.c
index 7e7eae80372..dfea88eca10 100644
--- a/src/backend/utils/activity/pgstat_bgwriter.c
+++ b/src/backend/utils/activity/pgstat_bgwriter.c
@@ -32,7 +32,7 @@ PgStat_MsgBgWriter PendingBgWriterStats;
  * Report bgwriter statistics
  */
 void
-pgstat_send_bgwriter(void)
+pgstat_report_bgwriter(void)
 {
 	/* We assume this initializes to zeroes */
 	static const PgStat_MsgBgWriter all_zeroes;
diff --git a/src/backend/utils/activity/pgstat_checkpointer.c b/src/backend/utils/activity/pgstat_checkpointer.c
index dbb9d861a4b..3f4e2054f55 100644
--- a/src/backend/utils/activity/pgstat_checkpointer.c
+++ b/src/backend/utils/activity/pgstat_checkpointer.c
@@ -32,7 +32,7 @@ PgStat_MsgCheckpointer PendingCheckpointerStats;
  * Report checkpointer statistics
  */
 void
-pgstat_send_checkpointer(void)
+pgstat_report_checkpointer(void)
 {
 	/* We assume this initializes to zeroes */
 	static const PgStat_MsgCheckpointer all_zeroes;
diff --git a/src/backend/utils/activity/pgstat_wal.c b/src/backend/utils/activity/pgstat_wal.c
index ad999887630..8680809deef 100644
--- a/src/backend/utils/activity/pgstat_wal.c
+++ b/src/backend/utils/activity/pgstat_wal.c
@@ -31,8 +31,8 @@ PgStat_MsgWal WalStats;
 
 /*
  * WAL usage counters saved from pgWALUsage at the previous call to
- * pgstat_send_wal(). This is used to calculate how much WAL usage
- * happens between pgstat_send_wal() calls, by subtracting
+ * pgstat_report_wal(). This is used to calculate how much WAL usage
+ * happens between pgstat_report_wal() calls, by subtracting
  * the previous counters from the current ones.
  */
 static WalUsage prevWalUsage;
@@ -45,7 +45,7 @@ static WalUsage prevWalUsage;
  * passed since last one was sent to reach PGSTAT_STAT_INTERVAL.
  */
 void
-pgstat_send_wal(bool force)
+pgstat_report_wal(bool force)
 {
 	static TimestampTz sendTime = 0;
 
@@ -133,7 +133,7 @@ void
 pgstat_wal_initialize(void)
 {
 	/*
-	 * Initialize prevWalUsage with pgWalUsage so that pgstat_send_wal() can
+	 * Initialize prevWalUsage with pgWalUsage so that pgstat_report_wal() can
 	 * calculate how much pgWalUsage counters are increased by subtracting
 	 * prevWalUsage from pgWalUsage.
 	 */
-- 
2.35.1.677.gabf474a5dd

