Commit 4da341b
committed
perf(issue-list): use collapse parameter to skip unused Snuba queries
The Sentry web UI optimizes issue list loading by sending collapse
parameters to /organizations/{org}/issues/, telling the server to
skip computing data the client won't use. This avoids expensive
Snuba/ClickHouse queries and saves 200-500ms per API request.
The CLI's issue list command never consumes filtered, lifetime, or
unhandled fields — these are always collapsed. The stats field
(sparkline data for the TREND column) is conditionally collapsed
when sparklines won't be rendered: JSON mode, narrow terminals
(<100 cols), and non-TTY output.
When stats are collapsed, groupStatsPeriod is also omitted since
the server won't compute stats anyway.
Changes:
- Add IssueCollapseField type and buildIssueListCollapse() to API layer
- Add collapse parameter to listIssuesPaginated/listIssuesAllPages
- Add willShowTrend() helper to formatters (avoids process.stdout in commands)
- Thread collapse through fetchIssuesForTarget, fetchWithBudget, fetchOrgAllIssues
- Property tests for buildIssueListCollapse invariants
- Integration tests verifying collapse reaches the API1 parent b590472 commit 4da341b
File tree
7 files changed
+392
-49
lines changed- src
- commands/issue
- lib
- api
- formatters
- test
- commands/issue
- lib
7 files changed
+392
-49
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
133 | 136 | | |
134 | 137 | | |
135 | 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 | + | |
136 | 181 | | |
137 | 182 | | |
138 | 183 | | |
| |||
502 | 547 | | |
503 | 548 | | |
504 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
505 | 554 | | |
506 | 555 | | |
507 | 556 | | |
508 | 557 | | |
509 | 558 | | |
510 | 559 | | |
511 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
512 | 565 | | |
513 | 566 | | |
514 | 567 | | |
| |||
578 | 631 | | |
579 | 632 | | |
580 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
581 | 638 | | |
582 | 639 | | |
583 | 640 | | |
| |||
792 | 849 | | |
793 | 850 | | |
794 | 851 | | |
795 | | - | |
| 852 | + | |
796 | 853 | | |
797 | 854 | | |
798 | 855 | | |
| 856 | + | |
| 857 | + | |
799 | 858 | | |
800 | 859 | | |
801 | 860 | | |
| |||
805 | 864 | | |
806 | 865 | | |
807 | 866 | | |
808 | | - | |
| 867 | + | |
| 868 | + | |
809 | 869 | | |
810 | 870 | | |
811 | 871 | | |
| |||
816 | 876 | | |
817 | 877 | | |
818 | 878 | | |
819 | | - | |
| 879 | + | |
| 880 | + | |
820 | 881 | | |
821 | 882 | | |
822 | 883 | | |
| |||
1110 | 1171 | | |
1111 | 1172 | | |
1112 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
1113 | 1176 | | |
1114 | 1177 | | |
1115 | 1178 | | |
| |||
1121 | 1184 | | |
1122 | 1185 | | |
1123 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
1124 | 1189 | | |
1125 | 1190 | | |
1126 | 1191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 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 | + | |
36 | 77 | | |
37 | 78 | | |
38 | 79 | | |
| |||
59 | 100 | | |
60 | 101 | | |
61 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
62 | 106 | | |
63 | 107 | | |
64 | 108 | | |
| |||
86 | 130 | | |
87 | 131 | | |
88 | 132 | | |
| 133 | + | |
89 | 134 | | |
90 | 135 | | |
91 | 136 | | |
| |||
138 | 183 | | |
139 | 184 | | |
140 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
141 | 189 | | |
142 | 190 | | |
143 | 191 | | |
| |||
161 | 209 | | |
162 | 210 | | |
163 | 211 | | |
| 212 | + | |
164 | 213 | | |
165 | 214 | | |
166 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
364 | 379 | | |
365 | 380 | | |
366 | 381 | | |
| |||
0 commit comments