Skip to content

Commit 0817ea7

Browse files
committed
docs: document that latency is measured in seconds
1 parent 50c5d70 commit 0817ea7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

interactions/api/gateway/state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ def __attrs_post_init__(self, *args, **kwargs) -> None:
5252

5353
@property
5454
def latency(self) -> float:
55-
"""Returns the latency of the websocket connection."""
55+
"""Returns the latency of the websocket connection (seconds)."""
5656
return self.gateway.latency
5757

5858
@property
5959
def average_latency(self) -> float:
60-
"""Returns the average latency of the websocket connection."""
60+
"""Returns the average latency of the websocket connection (seconds)."""
6161
return self.gateway.average_latency
6262

6363
@property

interactions/api/gateway/websocket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ async def __aexit__(
115115

116116
@property
117117
def average_latency(self) -> float:
118-
"""Get the average latency of the connection."""
118+
"""Get the average latency of the connection (seconds)."""
119119
if self._latency:
120120
return sum(self._latency) / len(self._latency)
121121
else:
122122
return float("inf")
123123

124124
@property
125125
def latency(self) -> float:
126-
"""Get the latency of the connection."""
126+
"""Get the latency of the connection (seconds)"""
127127
return self._latency[-1] if self._latency else float("inf")
128128

129129
@property

interactions/client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ def is_ready(self) -> bool:
440440

441441
@property
442442
def latency(self) -> float:
443-
"""Returns the latency of the websocket connection."""
443+
"""Returns the latency of the websocket connection (seconds)."""
444444
return self._connection_state.latency
445445

446446
@property
447447
def average_latency(self) -> float:
448-
"""Returns the average latency of the websocket connection."""
448+
"""Returns the average latency of the websocket connection (seconds)."""
449449
return self._connection_state.average_latency
450450

451451
@property

0 commit comments

Comments
 (0)