mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
pgstat: move pgstat_report_autovac() to pgstat_database.c.
I got the location wrong in 13619598f10. The name did make it sound like it belonged in pgstat_relation.c...
This commit is contained in:
parent
46a2d2499a
commit
c3e9b07936
@ -54,6 +54,26 @@ pgstat_drop_database(Oid databaseid)
|
||||
pgstat_send(&msg, sizeof(msg));
|
||||
}
|
||||
|
||||
/*
|
||||
* Called from autovacuum.c to report startup of an autovacuum process.
|
||||
* We are called before InitPostgres is done, so can't rely on MyDatabaseId;
|
||||
* the db OID must be passed in, instead.
|
||||
*/
|
||||
void
|
||||
pgstat_report_autovac(Oid dboid)
|
||||
{
|
||||
PgStat_MsgAutovacStart msg;
|
||||
|
||||
if (pgStatSock == PGINVALID_SOCKET)
|
||||
return;
|
||||
|
||||
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_AUTOVAC_START);
|
||||
msg.m_databaseid = dboid;
|
||||
msg.m_start_time = GetCurrentTimestamp();
|
||||
|
||||
pgstat_send(&msg, sizeof(msg));
|
||||
}
|
||||
|
||||
/*
|
||||
* Tell the collector about a Hot Standby recovery conflict.
|
||||
*/
|
||||
|
@ -167,26 +167,6 @@ pgstat_drop_relation(Oid relid)
|
||||
}
|
||||
#endif /* NOT_USED */
|
||||
|
||||
/*
|
||||
* Called from autovacuum.c to report startup of an autovacuum process.
|
||||
* We are called before InitPostgres is done, so can't rely on MyDatabaseId;
|
||||
* the db OID must be passed in, instead.
|
||||
*/
|
||||
void
|
||||
pgstat_report_autovac(Oid dboid)
|
||||
{
|
||||
PgStat_MsgAutovacStart msg;
|
||||
|
||||
if (pgStatSock == PGINVALID_SOCKET)
|
||||
return;
|
||||
|
||||
pgstat_setheader(&msg.m_hdr, PGSTAT_MTYPE_AUTOVAC_START);
|
||||
msg.m_databaseid = dboid;
|
||||
msg.m_start_time = GetCurrentTimestamp();
|
||||
|
||||
pgstat_send(&msg, sizeof(msg));
|
||||
}
|
||||
|
||||
/*
|
||||
* Tell the collector about the table we just vacuumed.
|
||||
*/
|
||||
|
@ -1025,6 +1025,7 @@ extern void pgstat_send_checkpointer(void);
|
||||
*/
|
||||
|
||||
extern void pgstat_drop_database(Oid databaseid);
|
||||
extern void pgstat_report_autovac(Oid dboid);
|
||||
extern void pgstat_report_recovery_conflict(int reason);
|
||||
extern void pgstat_report_deadlock(void);
|
||||
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);
|
||||
|
||||
extern void pgstat_relation_init(Relation rel);
|
||||
|
||||
extern void pgstat_report_autovac(Oid dboid);
|
||||
extern void pgstat_report_vacuum(Oid tableoid, bool shared,
|
||||
PgStat_Counter livetuples, PgStat_Counter deadtuples);
|
||||
extern void pgstat_report_analyze(Relation rel,
|
||||
|
Loading…
x
Reference in New Issue
Block a user