Lightweight request time container compatible with logging atoms. Uses time.monotonic() elapsed seconds instead of datetime.now() syscalls. Provides .seconds and .microseconds attributes for glogging.py compatibility.
| 25 | |
| 26 | |
| 27 | class _RequestTime: |
| 28 | """Lightweight request time container compatible with logging atoms. |
| 29 | |
| 30 | Uses time.monotonic() elapsed seconds instead of datetime.now() syscalls. |
| 31 | Provides .seconds and .microseconds attributes for glogging.py compatibility. |
| 32 | """ |
| 33 | |
| 34 | __slots__ = ('seconds', 'microseconds') |
| 35 | |
| 36 | def __init__(self, elapsed): |
| 37 | self.seconds = int(elapsed) |
| 38 | self.microseconds = int((elapsed - self.seconds) * 1_000_000) |
| 39 | |
| 40 | |
| 41 | def _normalize_sockaddr(sockaddr): |
no outgoing calls