Fractional milliseconds since `since`; the early hops are normally sub-millisecond so whole-ms resolution would round them all to zero.
(since: DateTime<Utc>)
| 35 | /// Fractional milliseconds since `since`; the early hops are normally |
| 36 | /// sub-millisecond so whole-ms resolution would round them all to zero. |
| 37 | pub(crate) fn elapsed_millis(since: DateTime<Utc>) -> f64 { |
| 38 | let elapsed = Utc::now().signed_duration_since(since); |
| 39 | elapsed |
| 40 | .num_microseconds() |
| 41 | .map(|us| us as f64 / 1000.0) |
| 42 | .unwrap_or_else(|| elapsed.num_milliseconds() as f64) |
| 43 | } |
| 44 | |
| 45 | pub(crate) fn event_source_label(source: EventSource) -> &'static str { |
| 46 | match source { |
no outgoing calls
no test coverage detected