forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9aea73f
committed
Add backend-level statistics to pgstats
This adds a new variable-numbered statistics kind in pgstats, where theobject ID key of the stats entries is based on the proc number of thebackends. This acts as an upper-bound for the number of stats entriesthat can exist at once. The entries are created when a backend startsafter authentication succeeds, and are removed when the backend exits,making the stats entry exist for as long as their backend is up andrunning. These are not written to the pgstats file at shutdown (notethat write_to_file is disabled, as a safety measure).Currently, these stats include only information about the I/O generatedby a backend, using the same layer as pg_stat_io, except that it is nowpossible to know how much activity is happening in each backend ratherthan an overall aggregate of all the activity. A function calledpg_stat_get_backend_io() is added to access this data depending on thePID of a backend. The existing structure could be expanded in thefuture to add more information about other statistics related tobackends, depending on requirements or ideas.Auxiliary processes are not included in this set of statistics. Theseare less interesting to have than normal backends as they have dedicatedentries in pg_stat_io, and stats kinds of their own.This commit includes also pg_stat_reset_backend_stats(), function ableto reset all the stats associated to a single backend.Bump catalog version and PGSTAT_FILE_FORMAT_ID.Author: Bertrand DrouvotReviewed-by: Álvaro Herrera, Kyotaro Horiguchi, Michael Paquier, NazirBilal YavuzDiscussion:https://postgr.es/m/ZtXR+CtkEVVE/LHF@ip-10-97-1-34.eu-west-3.compute.internal1 parentff7c40d commit9aea73f
File tree
18 files changed
+553
-29
lines changed- doc/src/sgml
- src
- backend
- catalog
- utils
- activity
- adt
- include
- catalog
- utils
- test/regress
- expected
- sql
- tools/pgindent
18 files changed
+553
-29
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8403 | 8403 |
| |
8404 | 8404 |
| |
8405 | 8405 |
| |
8406 |
| - | |
8407 |
| - | |
8408 |
| - | |
| 8406 | + | |
| 8407 | + | |
| 8408 | + | |
| 8409 | + | |
| 8410 | + | |
8409 | 8411 |
| |
8410 | 8412 |
| |
8411 | 8413 |
| |
|
Lines changed: 39 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4790 | 4790 |
| |
4791 | 4791 |
| |
4792 | 4792 |
| |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
| 4805 | + | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
| 4809 | + | |
| 4810 | + | |
| 4811 | + | |
| 4812 | + | |
| 4813 | + | |
4793 | 4814 |
| |
4794 | 4815 |
| |
4795 | 4816 |
| |
| |||
4971 | 4992 |
| |
4972 | 4993 |
| |
4973 | 4994 |
| |
| 4995 | + | |
| 4996 | + | |
| 4997 | + | |
| 4998 | + | |
| 4999 | + | |
| 5000 | + | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
| 5006 | + | |
| 5007 | + | |
| 5008 | + | |
| 5009 | + | |
| 5010 | + | |
| 5011 | + | |
| 5012 | + | |
4974 | 5013 |
| |
4975 | 5014 |
| |
4976 | 5015 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
711 | 711 |
| |
712 | 712 |
| |
713 | 713 |
| |
| 714 | + | |
| 715 | + | |
714 | 716 |
| |
715 | 717 |
| |
716 | 718 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
426 | 426 |
| |
427 | 427 |
| |
428 | 428 |
| |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
429 | 433 |
| |
430 | 434 |
| |
431 | 435 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
| |||
358 | 359 |
| |
359 | 360 |
| |
360 | 361 |
| |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
361 | 378 |
| |
362 | 379 |
| |
363 | 380 |
| |
| |||
602 | 619 |
| |
603 | 620 |
| |
604 | 621 |
| |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
605 | 626 |
| |
606 | 627 |
| |
607 | 628 |
| |
|
Lines changed: 188 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 | + |
Lines changed: 17 additions & 8 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 | 23 |
| |
32 | 24 |
| |
33 | 25 |
| |
| |||
87 | 79 |
| |
88 | 80 |
| |
89 | 81 |
| |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
90 | 90 |
| |
91 | 91 |
| |
92 | 92 |
| |
| |||
148 | 148 |
| |
149 | 149 |
| |
150 | 150 |
| |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
151 | 160 |
| |
152 | 161 |
| |
153 | 162 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
264 | 264 |
| |
265 | 265 |
| |
266 | 266 |
| |
| 267 | + | |
267 | 268 |
| |
268 | 269 |
| |
269 | 270 |
| |
| |||
350 | 351 |
| |
351 | 352 |
| |
352 | 353 |
| |
| 354 | + | |
353 | 355 |
| |
354 | 356 |
| |
355 | 357 |
| |
|
0 commit comments
Comments
(0)