1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-22 12:22:45 +03:00

pgstat: move pgstat_report_autovac() to pgstat_database.c.

I got the location wrong in 13619598f1. The name did make it sound like it
belonged in pgstat_relation.c...
This commit is contained in:
Andres Freund
2022-04-06 12:41:29 -07:00
parent 46a2d2499a
commit c3e9b07936
3 changed files with 21 additions and 21 deletions

View File

@@ -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.
*/