diff options
author | Andres Freund <andres@anarazel.de> | 2022-03-19 11:32:18 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-03-19 11:42:22 -0700 |
commit | a3a75b982b5bb6fba95ad8b3d48e70439dcd2329 (patch) | |
tree | 79e4ed837b9dc4c104f6996e8f49f83134815bbb | |
parent | 50b1e8c51b3c779bdfce5cd61bf4bbc80fd48377 (diff) | |
download | postgresql-a3a75b982b5bb6fba95ad8b3d48e70439dcd2329.tar.gz postgresql-a3a75b982b5bb6fba95ad8b3d48e70439dcd2329.zip |
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
-rw-r--r-- | src/backend/postmaster/pgstat.c | 28 | ||||
-rw-r--r-- | src/include/pgstat.h | 4 | ||||
-rw-r--r-- | src/tools/pgindent/typedefs.list | 3 |
3 files changed, 21 insertions, 14 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 53ddd930e6e..8df60f26814 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -265,7 +265,7 @@ typedef struct TwoPhasePgStatRecord PgStat_Counter deleted_pre_truncdrop; Oid t_id; /* table's OID */ bool t_shared; /* is it a shared catalog? */ - bool t_truncdropped; /* was the relation truncated/dropped? */ + bool t_truncdropped; /* was the relation truncated/dropped? */ } TwoPhasePgStatRecord; /* @@ -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 - * reuse the record instead of going through a - * palloc/pfree pushup (this works since it's all in - * TopTransactionContext anyway). We have to re-link it - * into the parent level, though, and that might mean - * pushing a new entry into the pgStatXactStack. + * reuse the record instead of going through a palloc/pfree + * pushup (this works since it's all in TopTransactionContext + * anyway). We have to re-link it into the parent level, + * though, and that might mean pushing a new entry into the + * pgStatXactStack. */ PgStat_SubXactStatus *upper_xact_state; @@ -3352,9 +3352,9 @@ pgstat_send_wal(bool force) WalUsage walusage; /* - * Calculate how much WAL usage counters were increased by - * subtracting the previous counters from the current ones. Fill the - * results in WAL stats message. + * Calculate how much WAL usage counters were increased by subtracting + * the previous counters from the current ones. Fill the results in + * WAL stats message. */ MemSet(&walusage, 0, sizeof(WalUsage)); WalUsageAccumDiff(&walusage, &pgWalUsage, &prevWalUsage); @@ -4211,7 +4211,7 @@ pgstat_read_statsfiles(Oid onlydb, bool permanent, bool deep) bool found; const char *statfile = permanent ? PGSTAT_STAT_PERMANENT_FILENAME : pgstat_stat_filename; int i; - TimestampTz ts; + TimestampTz ts; /* * The tables will live in pgStatLocalContext. @@ -4473,7 +4473,7 @@ pgstat_read_statsfiles(Oid onlydb, bool permanent, bool deep) PgStat_StatSubEntry *subentry; if (fread(&subbuf, 1, sizeof(PgStat_StatSubEntry), fpin) - != sizeof(PgStat_StatSubEntry)) + != sizeof(PgStat_StatSubEntry)) { ereport(pgStatRunningInCollector ? LOG : WARNING, (errmsg("corrupted statistics file \"%s\"", @@ -5250,6 +5250,7 @@ pgstat_recv_tabstat(PgStat_MsgTabstat *msg, int len) tabentry->tuples_updated += tabmsg->t_counts.t_tuples_updated; tabentry->tuples_deleted += tabmsg->t_counts.t_tuples_deleted; tabentry->tuples_hot_updated += tabmsg->t_counts.t_tuples_hot_updated; + /* * If table was truncated/dropped, first reset the live/dead * counters. @@ -5412,7 +5413,10 @@ pgstat_recv_resetsharedcounter(PgStat_MsgResetsharedcounter *msg, int len) { 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)); globalStats.bgwriter.stat_reset_timestamp = GetCurrentTimestamp(); } diff --git a/src/include/pgstat.h b/src/include/pgstat.h index be2f7e2bcc7..95f595353dc 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -190,8 +190,8 @@ typedef struct PgStat_TableXactStatus PgStat_Counter tuples_inserted; /* tuples inserted in (sub)xact */ PgStat_Counter tuples_updated; /* tuples updated in (sub)xact */ PgStat_Counter tuples_deleted; /* tuples deleted in (sub)xact */ - bool truncdropped; /* relation truncated/dropped in this - * (sub)xact */ + bool truncdropped; /* relation truncated/dropped in this + * (sub)xact */ /* tuples i/u/d prior to truncate/drop */ PgStat_Counter inserted_pre_truncdrop; PgStat_Counter updated_pre_truncdrop; diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index d8e228d89ad..93d51905086 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -1917,6 +1917,8 @@ PgFdwScanState PgIfAddrCallback PgStat_ArchiverStats PgStat_BackendFunctionEntry +PgStat_BgWriterStats +PgStat_CheckpointerStats PgStat_Counter PgStat_FunctionCallUsage PgStat_FunctionCounts @@ -1928,6 +1930,7 @@ PgStat_MsgAnlAncestors PgStat_MsgArchiver PgStat_MsgAutovacStart PgStat_MsgBgWriter +PgStat_MsgCheckpointer PgStat_MsgChecksumFailure PgStat_MsgConnect PgStat_MsgDeadlock |