Commit ef95d7c
Yuriy Bezsonov
feat(perf-platform): dual-mode profiling and version diff lanes
Rework the perf-platform implementation around dual-mode async-profiler
(CPU + wall via -e cpu --wall 10ms) and add a six-lane analyzer that
runs CPU top-N, wall top-N, CPU diff, wall diff, JFR, and thread dump
in parallel against a target workload.
Collector
- Replace the rolling JFR ring approach with a rotating async-profiler
session (--loop 15s -o jfr) that produces one JFR file per cycle and
pushes each completed file to Pyroscope's /ingest endpoint. Pyroscope
splits each push into process_cpu and wall profile types.
- Drop the separate jcmd-based JFR.start path. On-demand JFR uses asprof
dump on the same running session.
- Introduce versionFrom() resolution: explicit perf-profile/version
label wins, otherwise fall back to the image tag.
Analyzer
- PyroscopeTool grows topFunctions(service, profileType, from, to, n)
and diff(service, profileType, baseline, current, from, to, n). Both
accept either 'cpu' or 'wall' to pick which Pyroscope profile type to
query. Diff ranks frames by total-time share (frame plus descendants)
so application callers that walk into a new hotspot or contended
primitive show up directly.
- AnalysisService runs six lanes via virtual threads: pre-fetched
Pyroscope top-N for both profile types, version diffs for both
profile types, JFR via the collector, and thread dump via the
collector. AnalysisContext carries the four pre-fetched Markdown
blocks.
- AiService renders both diffs first, then both top-N tables, with a
system prompt instructing the model to lead with what changed and
cross-check CPU vs wall diffs.
- Add ProfileRatioExporter and PyroscopeVersionService: an internal
Prometheus gauge perf_profile_cpu_ratio whose value is the latest
version's CPU total over the prior version's, intended as the alert
source for canary regression detection. Grafana OSS has no
recording-rule engine, so this lives in the analyzer.
Infrastructure
- CDK PerfPlatform construct provisions pyroscope-eks-pod-role for
Pyroscope's S3 backend and perf-analyzer-eks-pod-role for the
analyzer's Bedrock + S3 + workload-source-code access.
- perf-platform.sh creates pod identity associations, installs the
Grafana alert rule and contact point that calls the analyzer's
/api/v1/grafana-webhook, and applies RBAC for the
analyzer/collector ServiceAccounts.1 parent 27228b3 commit ef95d7c
16 files changed
Lines changed: 1205 additions & 324 deletions
File tree
- apps
- perf-analyzer/src/main
- java/com/example/perf/analyzer
- resources
- perf-collector
- src/main
- java/com/example/perf/collector
- resources
- infra
- cdk/src/main/java/sample/com
- constructs
- scripts/setup
Lines changed: 100 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 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 | + | |
38 | 64 | | |
39 | 65 | | |
40 | 66 | | |
| |||
87 | 113 | | |
88 | 114 | | |
89 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
90 | 122 | | |
91 | 123 | | |
92 | 124 | | |
93 | 125 | | |
94 | 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 | + | |
95 | 170 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
99 | 184 | | |
100 | 185 | | |
101 | 186 | | |
| |||
117 | 202 | | |
118 | 203 | | |
119 | 204 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
123 | 211 | | |
124 | 212 | | |
125 | 213 | | |
| |||
Lines changed: 90 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
130 | 143 | | |
131 | 144 | | |
132 | 145 | | |
133 | 146 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
140 | 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 | + | |
141 | 180 | | |
142 | 181 | | |
143 | 182 | | |
144 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
145 | 187 | | |
146 | 188 | | |
147 | 189 | | |
148 | 190 | | |
149 | 191 | | |
150 | | - | |
151 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
152 | 200 | | |
153 | 201 | | |
154 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
155 | 206 | | |
156 | 207 | | |
157 | 208 | | |
| |||
160 | 211 | | |
161 | 212 | | |
162 | 213 | | |
163 | | - | |
| 214 | + | |
164 | 215 | | |
165 | 216 | | |
166 | 217 | | |
| |||
354 | 405 | | |
355 | 406 | | |
356 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
357 | 419 | | |
358 | 420 | | |
359 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
360 | 431 | | |
361 | 432 | | |
362 | 433 | | |
| |||
378 | 449 | | |
379 | 450 | | |
380 | 451 | | |
381 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
382 | 458 | | |
383 | 459 | | |
384 | 460 | | |
| |||
0 commit comments