mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
pgstat: run pgindent on pgstat.c/h.
Upcoming commits will touch a lot of the pgstats code. Reindenting separately makes it easier to keep the code in a well-formatted shape each step. Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de
This commit is contained in:
@ -2622,11 +2622,11 @@ AtEOSubXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit, in
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* When there isn't an immediate parent state, we can just
|
* When there isn't an immediate parent state, we can just
|
||||||
* reuse the record instead of going through a
|
* reuse the record instead of going through a palloc/pfree
|
||||||
* palloc/pfree pushup (this works since it's all in
|
* pushup (this works since it's all in TopTransactionContext
|
||||||
* TopTransactionContext anyway). We have to re-link it
|
* anyway). We have to re-link it into the parent level,
|
||||||
* into the parent level, though, and that might mean
|
* though, and that might mean pushing a new entry into the
|
||||||
* pushing a new entry into the pgStatXactStack.
|
* pgStatXactStack.
|
||||||
*/
|
*/
|
||||||
PgStat_SubXactStatus *upper_xact_state;
|
PgStat_SubXactStatus *upper_xact_state;
|
||||||
|
|
||||||
@ -3352,9 +3352,9 @@ pgstat_send_wal(bool force)
|
|||||||
WalUsage walusage;
|
WalUsage walusage;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate how much WAL usage counters were increased by
|
* Calculate how much WAL usage counters were increased by subtracting
|
||||||
* subtracting the previous counters from the current ones. Fill the
|
* the previous counters from the current ones. Fill the results in
|
||||||
* results in WAL stats message.
|
* WAL stats message.
|
||||||
*/
|
*/
|
||||||
MemSet(&walusage, 0, sizeof(WalUsage));
|
MemSet(&walusage, 0, sizeof(WalUsage));
|
||||||
WalUsageAccumDiff(&walusage, &pgWalUsage, &prevWalUsage);
|
WalUsageAccumDiff(&walusage, &pgWalUsage, &prevWalUsage);
|
||||||
@ -5250,6 +5250,7 @@ pgstat_recv_tabstat(PgStat_MsgTabstat *msg, int len)
|
|||||||
tabentry->tuples_updated += tabmsg->t_counts.t_tuples_updated;
|
tabentry->tuples_updated += tabmsg->t_counts.t_tuples_updated;
|
||||||
tabentry->tuples_deleted += tabmsg->t_counts.t_tuples_deleted;
|
tabentry->tuples_deleted += tabmsg->t_counts.t_tuples_deleted;
|
||||||
tabentry->tuples_hot_updated += tabmsg->t_counts.t_tuples_hot_updated;
|
tabentry->tuples_hot_updated += tabmsg->t_counts.t_tuples_hot_updated;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If table was truncated/dropped, first reset the live/dead
|
* If table was truncated/dropped, first reset the live/dead
|
||||||
* counters.
|
* counters.
|
||||||
@ -5412,7 +5413,10 @@ pgstat_recv_resetsharedcounter(PgStat_MsgResetsharedcounter *msg, int len)
|
|||||||
{
|
{
|
||||||
if (msg->m_resettarget == RESET_BGWRITER)
|
if (msg->m_resettarget == RESET_BGWRITER)
|
||||||
{
|
{
|
||||||
/* Reset the global, bgwriter and checkpointer statistics for the cluster. */
|
/*
|
||||||
|
* Reset the global, bgwriter and checkpointer statistics for the
|
||||||
|
* cluster.
|
||||||
|
*/
|
||||||
memset(&globalStats, 0, sizeof(globalStats));
|
memset(&globalStats, 0, sizeof(globalStats));
|
||||||
globalStats.bgwriter.stat_reset_timestamp = GetCurrentTimestamp();
|
globalStats.bgwriter.stat_reset_timestamp = GetCurrentTimestamp();
|
||||||
}
|
}
|
||||||
|
@ -1917,6 +1917,8 @@ PgFdwScanState
|
|||||||
PgIfAddrCallback
|
PgIfAddrCallback
|
||||||
PgStat_ArchiverStats
|
PgStat_ArchiverStats
|
||||||
PgStat_BackendFunctionEntry
|
PgStat_BackendFunctionEntry
|
||||||
|
PgStat_BgWriterStats
|
||||||
|
PgStat_CheckpointerStats
|
||||||
PgStat_Counter
|
PgStat_Counter
|
||||||
PgStat_FunctionCallUsage
|
PgStat_FunctionCallUsage
|
||||||
PgStat_FunctionCounts
|
PgStat_FunctionCounts
|
||||||
@ -1928,6 +1930,7 @@ PgStat_MsgAnlAncestors
|
|||||||
PgStat_MsgArchiver
|
PgStat_MsgArchiver
|
||||||
PgStat_MsgAutovacStart
|
PgStat_MsgAutovacStart
|
||||||
PgStat_MsgBgWriter
|
PgStat_MsgBgWriter
|
||||||
|
PgStat_MsgCheckpointer
|
||||||
PgStat_MsgChecksumFailure
|
PgStat_MsgChecksumFailure
|
||||||
PgStat_MsgConnect
|
PgStat_MsgConnect
|
||||||
PgStat_MsgDeadlock
|
PgStat_MsgDeadlock
|
||||||
|
Reference in New Issue
Block a user