forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7553443
committed
injection_points: Add some cumulative stats for injection points
This acts as a template of what can be achieved with the pluggablecumulative stats APIs introduced in7949d95 for thevariable-numbered case where stats entries are stored in the pgstatsdshash, while being potentially useful on its own for injection points,say to add starting and/or stopping conditions based on the statistics(want to trigger a callback after N calls, for example?).Currently, the only data gathered is the number of times an injectionpoint is run. More fields can always be added as required. All theroutines related to the stats are located in their own file, calledinjection_stats.c in the test module injection_points, for clarity.The stats can be used only if the test module is loaded throughshared_preload_libraries. The key of the dshash uses InvalidOid for thedatabase, and an int4 hash of the injection point name as object ID.A TAP test is added to provide coverage for the new custom cumulativestats APIs, showing the persistency of the data across restarts, forexample.Author: Michael PaquierReviewed-by: Dmitry Dolgov, Bertrand DrouvotDiscussion:https://postgr.es/m/Zmqm9j5EO0I4W8dx@paquier.xyz1 parent2eff9e6 commit7553443
File tree
9 files changed
+332
-2
lines changed- doc/src/sgml
- src
- test/modules/injection_points
- t
- tools/pgindent
9 files changed
+332
-2
lines changedLines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3919 | 3919 |
| |
3920 | 3920 |
| |
3921 | 3921 |
| |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
3922 | 3927 |
| |
3923 | 3928 |
| |
3924 | 3929 |
| |
|
Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
4 |
| - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 |
| |
6 | 9 |
| |
7 | 10 |
| |
| |||
11 | 14 |
| |
12 | 15 |
| |
13 | 16 |
| |
| 17 | + | |
| 18 | + | |
14 | 19 |
| |
15 | 20 |
| |
16 | 21 |
| |
| 22 | + | |
| 23 | + | |
17 | 24 |
| |
18 | 25 |
| |
19 | 26 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + |
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
| 174 | + | |
| 175 | + | |
| 176 | + | |
173 | 177 |
| |
174 | 178 |
| |
175 | 179 |
| |
| |||
182 | 186 |
| |
183 | 187 |
| |
184 | 188 |
| |
| 189 | + | |
| 190 | + | |
185 | 191 |
| |
186 | 192 |
| |
187 | 193 |
| |
| |||
193 | 199 |
| |
194 | 200 |
| |
195 | 201 |
| |
| 202 | + | |
| 203 | + | |
196 | 204 |
| |
197 | 205 |
| |
198 | 206 |
| |
| |||
211 | 219 |
| |
212 | 220 |
| |
213 | 221 |
| |
| 222 | + | |
| 223 | + | |
214 | 224 |
| |
215 | 225 |
| |
216 | 226 |
| |
| |||
299 | 309 |
| |
300 | 310 |
| |
301 | 311 |
| |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
302 | 316 |
| |
303 | 317 |
| |
304 | 318 |
| |
| |||
431 | 445 |
| |
432 | 446 |
| |
433 | 447 |
| |
| 448 | + | |
| 449 | + | |
| 450 | + | |
434 | 451 |
| |
435 | 452 |
| |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + |
Lines changed: 197 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + |
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| 9 | + | |
9 | 10 |
| |
10 | 11 |
| |
11 | 12 |
| |
| |||
42 | 43 |
| |
43 | 44 |
| |
44 | 45 |
| |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
45 | 54 |
|
0 commit comments
Comments
(0)