Commit c5a9ccd
committed
Proof of concept: Add timestamps to tracebacks.
This came up at work as a suggestion to make debugging what happened in
big async servers with lots of exception groups and exceptions easier.
Timestamps when emitting exception groups containing tracebacks often
with their own nested causes would allow some semblance of order to be
understood.
This is a demo. If we want such a feature, we should settle on
semantics in a Discuss thread and write it up as a PEP. This should be
simpler than exception notes (PEP-678) was. One thought was just to
store the timestamp as a note; but that'd involve string and list
creation on every exception.
Performance testing needs to be done. This is the kind of thing that is
visually distracting, so not all applications want to _see_ the
timestamps. A knob to turn that on for those who do seems more useful
rather than making that the default. But the performance impact of
merely collecting the timestamps is worth knowing.1 parent 7d27561 commit c5a9ccd
3 files changed
Lines changed: 28 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
| 187 | + | |
186 | 188 | | |
187 | | - | |
| 189 | + | |
188 | 190 | | |
189 | | - | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | | - | |
| 194 | + | |
193 | 195 | | |
194 | | - | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
1004 | 1006 | | |
1005 | 1007 | | |
1006 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
1007 | 1011 | | |
1008 | 1012 | | |
1009 | 1013 | | |
| |||
1057 | 1061 | | |
1058 | 1062 | | |
1059 | 1063 | | |
| 1064 | + | |
| 1065 | + | |
1060 | 1066 | | |
1061 | 1067 | | |
1062 | 1068 | | |
| |||
1228 | 1234 | | |
1229 | 1235 | | |
1230 | 1236 | | |
1231 | | - | |
| 1237 | + | |
1232 | 1238 | | |
1233 | 1239 | | |
1234 | 1240 | | |
1235 | 1241 | | |
1236 | 1242 | | |
1237 | 1243 | | |
1238 | 1244 | | |
1239 | | - | |
| 1245 | + | |
1240 | 1246 | | |
1241 | 1247 | | |
1242 | 1248 | | |
1243 | 1249 | | |
1244 | 1250 | | |
1245 | 1251 | | |
1246 | | - | |
| 1252 | + | |
1247 | 1253 | | |
1248 | 1254 | | |
1249 | 1255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | | - | |
188 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
189 | 193 | | |
190 | 194 | | |
191 | | - | |
| 195 | + | |
| 196 | + | |
192 | 197 | | |
193 | 198 | | |
194 | 199 | | |
| |||
597 | 602 | | |
598 | 603 | | |
599 | 604 | | |
| 605 | + | |
| 606 | + | |
600 | 607 | | |
601 | 608 | | |
602 | 609 | | |
| |||
0 commit comments