Skip to content

Commit 31f29fb

Browse files
committed
Replace ConnectionCheckedOutEvent/ConnectionCheckOutFailedEvent.waited with duration
DRIVERS-2469
1 parent b28adf8 commit 31f29fb

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,8 @@ See the `Load Balancer Specification <../load-balancers/load-balancers.rst#event
921921
* it is the time elapsed between the `ConnectionCreatedEvent`
922922
* emitted by the same checking out and this event.
923923
*
924-
* Naturally, this duration does not include any part of
925-
* `ConnectionCheckedOutEvent`/`ConnectionCheckOutFailedEvent.waited`.
924+
* Naturally, this duration is not greater than
925+
* `ConnectionCheckedOutEvent`/`ConnectionCheckOutFailedEvent.duration`.
926926
*
927927
* A driver that delivers events synchronously MUST NOT include in this duration
928928
* the time to deliver the `ConnectionCreatedEvent`.
@@ -995,9 +995,9 @@ See the `Load Balancer Specification <../load-balancers/load-balancers.rst#event
995995
reason: string|Enum;
996996
997997
/**
998-
* See `ConnectionCheckedOutEvent.waited`.
998+
* See `ConnectionCheckedOutEvent.duration`.
999999
*/
1000-
waited: Duration;
1000+
duration: Duration;
10011001
}
10021002
10031003
/**
@@ -1015,30 +1015,30 @@ See the `Load Balancer Specification <../load-balancers/load-balancers.rst#event
10151015
connectionId: int64;
10161016
10171017
/**
1018-
* The time elapsed waiting for conditions
1019-
* specified by `ConnectionPoolOptions.waitQueueTimeoutMS`.
1020-
* More specifically, the time elapsed between the `ConnectionCheckOutStartedEvent` and:
1021-
* - the `ConnectionCreatedEvent` emitted by the same checking out,
1022-
* if this checking out emitted `ConnectionCreatedEvent`;
1023-
* - this event, otherwise.
1018+
* The time it took to check out the connection.
1019+
* More specifically, the time elapsed between the `ConnectionCheckOutStartedEvent` and
1020+
* the `ConnectionCheckedOutEvent`/`ConnectionCheckOutFailedEvent`
1021+
* emitted by the same checking out.
10241022
*
1025-
* Naturally, this duration is usually
1023+
* Naturally, if a new connection was not created (`ConnectionCreatedEvent`)
1024+
* and established (`ConnectionReadyEvent`) as part of checking out,
1025+
* this duration is usually
10261026
* smaller than or equal to `ConnectionPoolOptions.waitQueueTimeoutMS`,
10271027
* but MAY occasionally be greater than that,
10281028
* because a driver does not provide hard real-time guarantees.
10291029
*
10301030
* A driver that delivers events synchronously MUST NOT include in this duration
1031-
* the time to deliver the `ConnectionCheckOutStartedEvent`, `ConnectionCreatedEvent`.
1031+
* the time to deliver the `ConnectionCheckOutStartedEvent`.
10321032
* Doing so eliminates a thing to worry about in support cases related to this duration,
10331033
* because the time to deliver synchronously is affected by user code.
10341034
* The driver MUST document this behavior
10351035
* as well as explicitly warn users that the behavior may change in the future.
10361036
*
10371037
* A driver MAY choose the type idiomatic to the driver.
10381038
* If the type chosen does not convey units, e.g., `int64`,
1039-
* then the driver MAY include units in the name, e.g., `waitedMS`.
1039+
* then the driver MAY include units in the name, e.g., `durationMS`.
10401040
*/
1041-
waited: Duration;
1041+
duration: Duration;
10421042
}
10431043
10441044
/**
@@ -1350,13 +1350,13 @@ In addition to the common fields defined above, this message MUST contain the fo
13501350
- If ``reason`` is ``ConnectionError``, the associated error. The type and format of this value is flexible; see the
13511351
`logging specification <../logging/logging.rst#representing-errors-in-log-messages>`_ for details on representing errors in log messages.
13521352

1353-
* - waitedMS
1353+
* - durationMS
13541354
- Int64
1355-
- ``ConnectionCheckOutFailedEvent.waited`` converted to milliseconds.
1355+
- ``ConnectionCheckOutFailedEvent.duration`` converted to milliseconds.
13561356

13571357
The unstructured form SHOULD be as follows, using the values defined in the structured format above to fill in placeholders as appropriate:
13581358

1359-
Checkout failed for connection to {{serverHost}}:{{serverPort}}. Reason: {{reason}}. Error: {{error}}. Waited: {{waitedMS}} ms
1359+
Checkout failed for connection to {{serverHost}}:{{serverPort}}. Reason: {{reason}}. Error: {{error}}. Duration: {{durationMS}} ms
13601360

13611361
Connection Checked Out
13621362
-----------------------
@@ -1378,13 +1378,13 @@ In addition to the common fields defined above, this message MUST contain the fo
13781378
- Int64
13791379
- The driver-generated ID for the connection as defined in `Connection <#connection>`_.
13801380

1381-
* - waitedMS
1381+
* - durationMS
13821382
- Int64
1383-
- ``ConnectionCheckedOutEvent.waited`` converted to milliseconds.
1383+
- ``ConnectionCheckedOutEvent.duration`` converted to milliseconds.
13841384

13851385
The unstructured form SHOULD be as follows, using the values defined in the structured format above to fill in placeholders as appropriate:
13861386

1387-
Connection checked out: address={serverHost}}:{{serverPort}}, driver-generated ID={{driverConnectionId}}, waited={{waitedMS}} ms
1387+
Connection checked out: address={serverHost}}:{{serverPort}}, driver-generated ID={{driverConnectionId}}, duration={{durationMS}} ms
13881388

13891389
Connection Checked In
13901390
---------------------

source/connection-monitoring-and-pooling/tests/logging/connection-logging.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
"long"
171171
]
172172
},
173-
"waitedMS": {
173+
"durationMS": {
174174
"$$type": [
175175
"double",
176176
"int",
@@ -237,7 +237,7 @@
237237
"long"
238238
]
239239
},
240-
"waitedMS": {
240+
"durationMS": {
241241
"$$type": [
242242
"double",
243243
"int",
@@ -506,7 +506,7 @@
506506
"error": {
507507
"$$exists": true
508508
},
509-
"waitedMS": {
509+
"durationMS": {
510510
"$$type": [
511511
"double",
512512
"int",

source/connection-monitoring-and-pooling/tests/logging/connection-logging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ tests:
7575
driverConnectionId: { $$type: [int, long] }
7676
serverHost: { $$type: string }
7777
serverPort: { $$type: [int, long] }
78-
waitedMS: { $$type: [double, int, long] }
78+
durationMS: { $$type: [double, int, long] }
7979

8080
- level: debug
8181
component: connection
@@ -100,7 +100,7 @@ tests:
100100
driverConnectionId: { $$type: [int, long] }
101101
serverHost: { $$type: string }
102102
serverPort: { $$type: [int, long] }
103-
waitedMS: { $$type: [double, int, long] }
103+
durationMS: { $$type: [double, int, long] }
104104

105105
- level: debug
106106
component: connection
@@ -221,4 +221,4 @@ tests:
221221
serverPort: { $$type: [int, long] }
222222
reason: "An error occurred while trying to establish a new connection"
223223
error: { $$exists: true }
224-
waitedMS: { $$type: [double, int, long] }
224+
durationMS: { $$type: [double, int, long] }

0 commit comments

Comments
 (0)