Commit afb7b79
authored
perf(http/prom): avoid oneshot channel for request duration start time (#4448)
RecordRequestDuration knows the start time at call() time, whereas
RecordResponseDuration defers it until the request body flushes. The
latter needs async delivery from the request body wrapper, but the
former is known synchronously.
Replace the shared oneshot::Receiver<Instant> in ResponseState with an
enum supporting both immediate and deferred start times, removing one
heap allocation per request.
Signed-off-by: Alejandro Martinez Ruiz <amr@buoyant.io>1 parent 5fac714 commit afb7b79
File tree
3 files changed
+25
-6
lines changed- linkerd/http/prom/src
- record_response
3 files changed
+25
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
85 | 105 | | |
86 | 106 | | |
87 | 107 | | |
| |||
269 | 289 | | |
270 | 290 | | |
271 | 291 | | |
272 | | - | |
| 292 | + | |
273 | 293 | | |
274 | 294 | | |
275 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
0 commit comments