Commit f2c52ee
committed
pg_waldump: Emit stats summary when interrupted by SIGINT
Previously, pg_waldump would not display its statistics summary if it
got interrupted by SIGINT (or say a simple Ctrl+C). It gains with this
commit a signal handler for SIGINT, trapping the signal to exit at the
earliest convenience to allow a display of the stats summary before
exiting. This makes the reports more interactive, similarly to strace
-c.
This new behavior makes the combination of the options --stats and
--follow much more useful, so as the user will get a report for any
invocation of pg_waldump in such a case. Information about the LSN
range of the stats computed is added as a header to the report
displayed.
This implementation comes from a suggestion by Álvaro Herrera and
myself, following a complaint by the author of this patch about --stats
and --follow not being useful together originally.
As documented, this is not supported on Windows, though its support
would be possible by catching the terminal events associated to Ctrl+C,
for example (this may require a more centralized implementation, as
other tools could benefit from a common API).
Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACUUx3PcK2z9h0_m7vehreZAUbcmOky9WSEpe8TofhV=PQ@mail.gmail.com1 parent 0df9641 commit f2c52ee
File tree
2 files changed
+57
-0
lines changed- doc/src/sgml/ref
- src/bin/pg_waldump
2 files changed
+57
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| |||
632 | 649 | | |
633 | 650 | | |
634 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
635 | 658 | | |
636 | 659 | | |
637 | 660 | | |
| |||
645 | 668 | | |
646 | 669 | | |
647 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
648 | 674 | | |
649 | 675 | | |
650 | 676 | | |
| |||
794 | 820 | | |
795 | 821 | | |
796 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
797 | 827 | | |
798 | 828 | | |
799 | 829 | | |
| |||
833 | 863 | | |
834 | 864 | | |
835 | 865 | | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
836 | 869 | | |
837 | 870 | | |
838 | 871 | | |
| |||
1084 | 1117 | | |
1085 | 1118 | | |
1086 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1087 | 1123 | | |
1088 | 1124 | | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1089 | 1131 | | |
1090 | 1132 | | |
1091 | 1133 | | |
| |||
1112 | 1154 | | |
1113 | 1155 | | |
1114 | 1156 | | |
| 1157 | + | |
1115 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
1116 | 1161 | | |
1117 | 1162 | | |
1118 | 1163 | | |
| |||
1127 | 1172 | | |
1128 | 1173 | | |
1129 | 1174 | | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
1130 | 1178 | | |
1131 | 1179 | | |
1132 | 1180 | | |
| |||
0 commit comments