- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit8fb580a
committed
pgstat: prepare APIs used by pgstatfuncs for shared memory stats.
With the introduction of PgStat_Kind PgStat_Single_Reset_Type,PgStat_Shared_Reset_Target don't make sense anymore. Replace them withPgStat_Kind.Instead of having dedicated reset functions for different kinds of stats, usetwo generic helper routines (one to reset all stats of a kind, one to resetone stats entry).A number of reset functions were named pgstat_reset_*_counter(), despiteaffecting multiple counters. The generic helper routines get rid ofpgstat_reset_single_counter(), pgstat_reset_subscription_counter().Rename pgstat_reset_slru_counter(), pgstat_reset_replslot_counter() topgstat_reset_slru(), pgstat_reset_replslot() respectively, and have them onlydeal with a single SLRU/slot. Resetting all SLRUs/slots goes through thegeneric pgstat_reset_of_kind().Previously pg_stat_reset_replication_slot() used SearchNamedReplicationSlot()to check if a slot exists. API wise it seems better to move that topgstat_replslot.c.This is done separately from the - quite large - shared memory statisticspatch to make review easier.Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://postgr.es/m/20220404041516.cctrvpadhuriawlq@alap3.anarazel.de1 parent997afad commit8fb580a
File tree
7 files changed
+161
-131
lines changed- src
- backend
- postmaster
- utils
- activity
- adt
- include
- tools/pgindent
7 files changed
+161
-131
lines changedLines changed: 92 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
| |||
1084 | 1084 |
| |
1085 | 1085 |
| |
1086 | 1086 |
| |
1087 |
| - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1088 | 1091 |
| |
1089 | 1092 |
| |
1090 | 1093 |
| |
1091 | 1094 |
| |
1092 | 1095 |
| |
1093 |
| - | |
| 1096 | + | |
1094 | 1097 |
| |
1095 |
| - | |
1096 | 1098 |
| |
1097 | 1099 |
| |
1098 | 1100 |
| |
1099 | 1101 |
| |
1100 |
| - | |
1101 |
| - | |
1102 |
| - | |
1103 |
| - | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
1104 | 1108 |
| |
1105 |
| - | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
1106 | 1130 |
| |
1107 | 1131 |
| |
1108 | 1132 |
| |
1109 |
| - | |
| 1133 | + | |
1110 | 1134 |
| |
1111 | 1135 |
| |
1112 | 1136 |
| |
1113 | 1137 |
| |
1114 | 1138 |
| |
1115 |
| - | |
| 1139 | + | |
1116 | 1140 |
| |
1117 |
| - | |
1118 |
| - | |
1119 | 1141 |
| |
1120 | 1142 |
| |
1121 | 1143 |
| |
1122 |
| - | |
1123 |
| - | |
1124 |
| - | |
1125 |
| - | |
1126 |
| - | |
1127 |
| - | |
1128 |
| - | |
1129 |
| - | |
1130 |
| - | |
1131 |
| - | |
1132 |
| - | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1133 | 1152 |
| |
1134 |
| - | |
1135 |
| - | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1136 | 1191 |
| |
1137 | 1192 |
| |
1138 | 1193 |
| |
| |||
1954 | 2009 |
| |
1955 | 2010 |
| |
1956 | 2011 |
| |
1957 |
| - | |
| 2012 | + | |
1958 | 2013 |
| |
1959 | 2014 |
| |
1960 | 2015 |
| |
| |||
1964 | 2019 |
| |
1965 | 2020 |
| |
1966 | 2021 |
| |
1967 |
| - | |
| 2022 | + | |
1968 | 2023 |
| |
1969 | 2024 |
| |
1970 | 2025 |
| |
| |||
3528 | 3583 |
| |
3529 | 3584 |
| |
3530 | 3585 |
| |
3531 |
| - | |
| 3586 | + | |
| 3587 | + | |
3532 | 3588 |
| |
3533 | 3589 |
| |
3534 | 3590 |
| |
| |||
3537 | 3593 |
| |
3538 | 3594 |
| |
3539 | 3595 |
| |
3540 |
| - | |
| 3596 | + | |
3541 | 3597 |
| |
3542 | 3598 |
| |
3543 | 3599 |
| |
3544 | 3600 |
| |
3545 | 3601 |
| |
3546 |
| - | |
| 3602 | + | |
3547 | 3603 |
| |
3548 | 3604 |
| |
3549 | 3605 |
| |
| |||
3577 | 3633 |
| |
3578 | 3634 |
| |
3579 | 3635 |
| |
3580 |
| - | |
| 3636 | + | |
3581 | 3637 |
| |
3582 | 3638 |
| |
3583 |
| - | |
| 3639 | + | |
3584 | 3640 |
| |
3585 | 3641 |
| |
3586 | 3642 |
| |
| |||
3626 | 3682 |
| |
3627 | 3683 |
| |
3628 | 3684 |
| |
3629 |
| - | |
| 3685 | + | |
3630 | 3686 |
| |
3631 | 3687 |
| |
3632 | 3688 |
| |
| |||
3643 | 3699 |
| |
3644 | 3700 |
| |
3645 | 3701 |
| |
3646 |
| - | |
| 3702 | + | |
3647 | 3703 |
| |
3648 | 3704 |
| |
3649 | 3705 |
| |
| |||
3963 | 4019 |
| |
3964 | 4020 |
| |
3965 | 4021 |
| |
3966 |
| - | |
| 4022 | + | |
3967 | 4023 |
| |
3968 | 4024 |
| |
3969 | 4025 |
| |
|
Lines changed: 26 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
27 |
| - | |
| 26 | + | |
28 | 27 |
| |
29 | 28 |
| |
30 | 29 |
| |
31 | 30 |
| |
32 | 31 |
| |
33 |
| - | |
| 32 | + | |
34 | 33 |
| |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
| 38 | + | |
37 | 39 |
| |
38 | 40 |
| |
39 | 41 |
| |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
46 |
| - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
47 | 48 |
| |
48 |
| - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
50 | 65 |
| |
51 | 66 |
| |
52 | 67 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 |
| - | |
| 42 | + | |
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| 46 | + | |
| 47 | + | |
46 | 48 |
| |
47 | 49 |
| |
48 | 50 |
| |
49 | 51 |
| |
50 |
| - | |
| 52 | + | |
51 | 53 |
| |
52 | 54 |
| |
53 | 55 |
| |
|
Lines changed: 0 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 | 23 |
| |
45 | 24 |
| |
46 | 25 |
| |
|
0 commit comments
Comments
(0)