forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9004abf
committed
Use pgstat_kind_infos to read fixed shared statistics
Shared statistics with a fixed number of objects are read from the statsfile in pgstat_read_statsfile() using members of PgStat_ShmemControl andfollowing an order based on their PgStat_Kind value.Instead of being explicit, this commit changes the stats read to iterateover the pgstat_kind_infos array to find the memory locations to readinto, based on a new shared_ctl_off in PgStat_KindInfo that can be usedto define the position of this stats kind in shared memory. This makesthe read logic simpler, and eases the introduction of futureimprovements aimed at making this area more pluggable for externalmodules.Original idea suggested by Andres Freund.Author: Tristan PartinReviewed-by: Andres Freund, Michael PaquierDiscussion:https://postgr.es/m/D12SQ7OYCD85.20BUVF3DWU5K7@neon.tech1 parenta1333ec commit9004abf
File tree
2 files changed
+42
-38
lines changed- src
- backend/utils/activity
- include/utils
2 files changed
+42
-38
lines changedLines changed: 36 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
344 | 348 |
| |
345 | 349 |
| |
346 | 350 |
| |
| |||
350 | 354 |
| |
351 | 355 |
| |
352 | 356 |
| |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
353 | 361 |
| |
354 | 362 |
| |
355 | 363 |
| |
| |||
359 | 367 |
| |
360 | 368 |
| |
361 | 369 |
| |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
362 | 374 |
| |
363 | 375 |
| |
364 | 376 |
| |
| |||
368 | 380 |
| |
369 | 381 |
| |
370 | 382 |
| |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
371 | 387 |
| |
372 | 388 |
| |
373 | 389 |
| |
| |||
377 | 393 |
| |
378 | 394 |
| |
379 | 395 |
| |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
380 | 400 |
| |
381 | 401 |
| |
382 | 402 |
| |
| |||
386 | 406 |
| |
387 | 407 |
| |
388 | 408 |
| |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
389 | 413 |
| |
390 | 414 |
| |
391 | 415 |
| |
| |||
1519 | 1543 |
| |
1520 | 1544 |
| |
1521 | 1545 |
| |
1522 |
| - | |
1523 |
| - | |
1524 |
| - | |
1525 |
| - | |
1526 |
| - | |
1527 |
| - | |
1528 |
| - | |
1529 |
| - | |
1530 |
| - | |
1531 |
| - | |
1532 |
| - | |
1533 |
| - | |
1534 |
| - | |
1535 |
| - | |
1536 |
| - | |
1537 |
| - | |
1538 |
| - | |
1539 |
| - | |
1540 |
| - | |
1541 |
| - | |
1542 |
| - | |
1543 |
| - | |
1544 |
| - | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
1545 | 1551 |
| |
1546 |
| - | |
1547 |
| - | |
1548 |
| - | |
1549 |
| - | |
1550 |
| - | |
| 1552 | + | |
| 1553 | + | |
1551 | 1554 |
| |
1552 |
| - | |
1553 |
| - | |
1554 |
| - | |
1555 |
| - | |
1556 |
| - | |
| 1555 | + | |
1557 | 1556 |
| |
1558 |
| - | |
1559 |
| - | |
1560 |
| - | |
1561 |
| - | |
1562 |
| - | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
1563 | 1561 |
| |
1564 | 1562 |
| |
1565 | 1563 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
202 | 208 |
| |
203 | 209 |
| |
204 | 210 |
| |
|
0 commit comments
Comments
(0)