This records the latency of the request. Note that it uses the handle to the histogram vector that was allocated at filter config creation time.
(&mut self, envoy_filter: &mut EHF)
| 61 | impl Filter { |
| 62 | /// This records the latency of the request. Note that it uses the handle to the histogram vector that was allocated at filter config creation time. |
| 63 | fn record_latency<EHF: EnvoyHttpFilter>(&mut self, envoy_filter: &mut EHF) { |
| 64 | let Some(start_time) = self.start_time else { |
| 65 | return; |
| 66 | }; |
| 67 | let Some(route_name) = self.route_name.take() else { |
| 68 | return; |
| 69 | }; |
| 70 | envoy_filter |
| 71 | .record_histogram_value_vec( |
| 72 | self.route_latency, |
| 73 | &[&self.version, &route_name], |
| 74 | start_time.elapsed().as_millis() as u64, |
| 75 | ) |
| 76 | .unwrap(); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /// This implements the [`envoy_proxy_dynamic_modules_rust_sdk::HttpFilter`] trait. |
no outgoing calls
no test coverage detected