Skip to content

Commit c3e9b07

Browse files
committed
pgstat: move pgstat_report_autovac() to pgstat_database.c.
I got the location wrong in 1361959. The name did make it sound like it belonged in pgstat_relation.c...
1 parent 46a2d24 commit c3e9b07

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/backend/utils/activity/pgstat_database.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ pgstat_drop_database(Oid databaseid)
5454
pgstat_send(&msg, sizeof(msg));
5555
}
5656

57+
/*
58+
* Called from autovacuum.c to report startup of an autovacuum process.
59+
* We are called before InitPostgres is done, so can't rely on MyDatabaseId;
60+
* the db OID must be passed in, instead.
61+
*/
62+
void
63+
pgstat_report_autovac(Oid dboid)
64+
{
65+
PgStat_MsgAutovacStart msg;
66+
67+
if (pgStatSock == PGINVALID_SOCKET)
68+
return;
69+
70+
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_AUTOVAC_START);
71+
msg.m_databaseid = dboid;
72+
msg.m_start_time = GetCurrentTimestamp();
73+
74+
pgstat_send(&msg, sizeof(msg));
75+
}
76+
5777
/*
5878
* Tell the collector about a Hot Standby recovery conflict.
5979
*/

src/backend/utils/activity/pgstat_relation.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,6 @@ pgstat_drop_relation(Oid relid)
167167
}
168168
#endif /* NOT_USED */
169169

170-
/*
171-
* Called from autovacuum.c to report startup of an autovacuum process.
172-
* We are called before InitPostgres is done, so can't rely on MyDatabaseId;
173-
* the db OID must be passed in, instead.
174-
*/
175-
void
176-
pgstat_report_autovac(Oid dboid)
177-
{
178-
PgStat_MsgAutovacStart msg;
179-
180-
if (pgStatSock == PGINVALID_SOCKET)
181-
return;
182-
183-
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_AUTOVAC_START);
184-
msg.m_databaseid = dboid;
185-
msg.m_start_time = GetCurrentTimestamp();
186-
187-
pgstat_send(&msg, sizeof(msg));
188-
}
189-
190170
/*
191171
* Tell the collector about the table we just vacuumed.
192172
*/

src/include/pgstat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ extern void pgstat_send_checkpointer(void);
10251025
*/
10261026

10271027
extern void pgstat_drop_database(Oid databaseid);
1028+
extern void pgstat_report_autovac(Oid dboid);
10281029
extern void pgstat_report_recovery_conflict(int reason);
10291030
extern void pgstat_report_deadlock(void);
10301031
extern void pgstat_report_checksum_failures_in_db(Oid dboid, int failurecount);
@@ -1060,7 +1061,6 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
10601061

10611062
extern void pgstat_relation_init(Relation rel);
10621063

1063-
extern void pgstat_report_autovac(Oid dboid);
10641064
extern void pgstat_report_vacuum(Oid tableoid, bool shared,
10651065
PgStat_Counter livetuples, PgStat_Counter deadtuples);
10661066
extern void pgstat_report_analyze(Relation rel,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy