Commit 7fd8db7
authored
refactor enhanced metrics monitoring (#901)
Use a long-running task that resumes at the start of an invocation,
instead of spawning a new task on each invocation. Uses a channel-based
service to pause and resume monitoring.
Tested with a function that opens a large number of file descriptors to
make sure it still captures data accurately. Tested with self-monitoring
as well (new implementation, previous implementation):
<img width="1337" height="316" alt="Screenshot 2025-10-20 at 4 16 47 PM"
src="https://github.com/user-attachments/assets/3e3a0470-8566-42f9-926b-2ae3df34a4f7"
/>1 parent 4a6eed2 commit 7fd8db7
7 files changed
Lines changed: 437 additions & 363 deletions
File tree
- bottlecap/src
- lifecycle/invocation
- metrics/enhanced
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
436 | 435 | | |
437 | 436 | | |
438 | 437 | | |
| |||
567 | 566 | | |
568 | 567 | | |
569 | 568 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | 569 | | |
574 | 570 | | |
575 | 571 | | |
576 | 572 | | |
577 | | - | |
578 | | - | |
579 | 573 | | |
580 | 574 | | |
581 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 149 | | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | | - | |
158 | | - | |
159 | 153 | | |
160 | 154 | | |
161 | 155 | | |
| |||
313 | 307 | | |
314 | 308 | | |
315 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
316 | 314 | | |
317 | 315 | | |
318 | 316 | | |
| |||
388 | 386 | | |
389 | 387 | | |
390 | 388 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | 389 | | |
396 | 390 | | |
397 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
| 494 | + | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| |||
0 commit comments