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

Commita3a75b9

Browse files
committed
pgstat: run pgindent on pgstat.c/h.
Upcoming commits will touch a lot of the pgstats code. Reindenting separatelymakes 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
1 parent50b1e8c commita3a75b9

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ typedef struct TwoPhasePgStatRecord
265265
PgStat_Counterdeleted_pre_truncdrop;
266266
Oidt_id;/* table's OID */
267267
boolt_shared;/* is it a shared catalog? */
268-
boolt_truncdropped;/* was the relation truncated/dropped? */
268+
boolt_truncdropped;/* was the relation truncated/dropped? */
269269
}TwoPhasePgStatRecord;
270270

271271
/*
@@ -2622,11 +2622,11 @@ AtEOSubXact_PgStat_Relations(PgStat_SubXactStatus *xact_state, bool isCommit, in
26222622
{
26232623
/*
26242624
* When there isn't an immediate parent state, we can just
2625-
* reuse the record instead of going through a
2626-
*palloc/pfreepushup (this works since it's all in
2627-
*TopTransactionContextanyway). We have to re-link it
2628-
*into the parent level,though, and that might mean
2629-
*pushing a new entry into thepgStatXactStack.
2625+
* reuse the record instead of going through a palloc/pfree
2626+
* pushup (this works since it's all in TopTransactionContext
2627+
* anyway). We have to re-link it into the parent level,
2628+
* though, and that might mean pushing a new entry into the
2629+
* pgStatXactStack.
26302630
*/
26312631
PgStat_SubXactStatus*upper_xact_state;
26322632

@@ -3352,9 +3352,9 @@ pgstat_send_wal(bool force)
33523352
WalUsagewalusage;
33533353

33543354
/*
3355-
* Calculate how much WAL usage counters were increased by
3356-
*subtractingthe previous counters from the current ones. Fill the
3357-
*results inWAL stats message.
3355+
* Calculate how much WAL usage counters were increased by subtracting
3356+
* the previous counters from the current ones. Fill the results in
3357+
* WAL stats message.
33583358
*/
33593359
MemSet(&walusage,0,sizeof(WalUsage));
33603360
WalUsageAccumDiff(&walusage,&pgWalUsage,&prevWalUsage);
@@ -4211,7 +4211,7 @@ pgstat_read_statsfiles(Oid onlydb, bool permanent, bool deep)
42114211
boolfound;
42124212
constchar*statfile=permanent ?PGSTAT_STAT_PERMANENT_FILENAME :pgstat_stat_filename;
42134213
inti;
4214-
TimestampTzts;
4214+
TimestampTzts;
42154215

42164216
/*
42174217
* The tables will live in pgStatLocalContext.
@@ -4473,7 +4473,7 @@ pgstat_read_statsfiles(Oid onlydb, bool permanent, bool deep)
44734473
PgStat_StatSubEntry*subentry;
44744474

44754475
if (fread(&subbuf,1,sizeof(PgStat_StatSubEntry),fpin)
4476-
!=sizeof(PgStat_StatSubEntry))
4476+
!=sizeof(PgStat_StatSubEntry))
44774477
{
44784478
ereport(pgStatRunningInCollector ?LOG :WARNING,
44794479
(errmsg("corrupted statistics file \"%s\"",
@@ -5250,6 +5250,7 @@ pgstat_recv_tabstat(PgStat_MsgTabstat *msg, int len)
52505250
tabentry->tuples_updated+=tabmsg->t_counts.t_tuples_updated;
52515251
tabentry->tuples_deleted+=tabmsg->t_counts.t_tuples_deleted;
52525252
tabentry->tuples_hot_updated+=tabmsg->t_counts.t_tuples_hot_updated;
5253+
52535254
/*
52545255
* If table was truncated/dropped, first reset the live/dead
52555256
* counters.
@@ -5412,7 +5413,10 @@ pgstat_recv_resetsharedcounter(PgStat_MsgResetsharedcounter *msg, int len)
54125413
{
54135414
if (msg->m_resettarget==RESET_BGWRITER)
54145415
{
5415-
/* Reset the global, bgwriter and checkpointer statistics for the cluster. */
5416+
/*
5417+
* Reset the global, bgwriter and checkpointer statistics for the
5418+
* cluster.
5419+
*/
54165420
memset(&globalStats,0,sizeof(globalStats));
54175421
globalStats.bgwriter.stat_reset_timestamp=GetCurrentTimestamp();
54185422
}

‎src/include/pgstat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ typedef struct PgStat_TableXactStatus
190190
PgStat_Countertuples_inserted;/* tuples inserted in (sub)xact */
191191
PgStat_Countertuples_updated;/* tuples updated in (sub)xact */
192192
PgStat_Countertuples_deleted;/* tuples deleted in (sub)xact */
193-
booltruncdropped;/* relation truncated/dropped in this
194-
* (sub)xact */
193+
booltruncdropped;/* relation truncated/dropped in this
194+
* (sub)xact */
195195
/* tuples i/u/d prior to truncate/drop */
196196
PgStat_Counterinserted_pre_truncdrop;
197197
PgStat_Counterupdated_pre_truncdrop;

‎src/tools/pgindent/typedefs.list

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,8 @@ PgFdwScanState
19171917
PgIfAddrCallback
19181918
PgStat_ArchiverStats
19191919
PgStat_BackendFunctionEntry
1920+
PgStat_BgWriterStats
1921+
PgStat_CheckpointerStats
19201922
PgStat_Counter
19211923
PgStat_FunctionCallUsage
19221924
PgStat_FunctionCounts
@@ -1928,6 +1930,7 @@ PgStat_MsgAnlAncestors
19281930
PgStat_MsgArchiver
19291931
PgStat_MsgAutovacStart
19301932
PgStat_MsgBgWriter
1933+
PgStat_MsgCheckpointer
19311934
PgStat_MsgChecksumFailure
19321935
PgStat_MsgConnect
19331936
PgStat_MsgDeadlock

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp