Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3e9b07

Browse files
committed
pgstat: move pgstat_report_autovac() to pgstat_database.c.
I got the location wrong in1361959. The name did make it sound like itbelonged in pgstat_relation.c...
1 parent46a2d24 commitc3e9b07

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(Oiddboid)
64+
{
65+
PgStat_MsgAutovacStartmsg;
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(Oiddboid)
177-
{
178-
PgStat_MsgAutovacStartmsg;
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
externvoidpgstat_drop_database(Oiddatabaseid);
1028+
externvoidpgstat_report_autovac(Oiddboid);
10281029
externvoidpgstat_report_recovery_conflict(intreason);
10291030
externvoidpgstat_report_deadlock(void);
10301031
externvoidpgstat_report_checksum_failures_in_db(Oiddboid,intfailurecount);
@@ -1060,7 +1061,6 @@ extern PgStat_BackendFunctionEntry *find_funcstat_entry(Oid func_id);
10601061

10611062
externvoidpgstat_relation_init(Relationrel);
10621063

1063-
externvoidpgstat_report_autovac(Oiddboid);
10641064
externvoidpgstat_report_vacuum(Oidtableoid,boolshared,
10651065
PgStat_Counterlivetuples,PgStat_Counterdeadtuples);
10661066
externvoidpgstat_report_analyze(Relationrel,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp