Skip to content

Commit 834c570

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCS-15652 write to wire metric (#1963)
* DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric * DOCS-15652-write-to-wire-metric Co-authored-by: jason-price-mongodb <[email protected]>
1 parent ceed21f commit 834c570

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

source/reference/command/serverStatus.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,8 @@ metrics
15071507
network : { // Added in MongoDB 6.2
15081508
totalEgressConnectionEstablishmentTimeMillis : Long("<num>"),
15091509
totalIngressTLSConnections : Long("<num>"),
1510-
totalIngressTLSHandshakeTimeMillis : Long("<num>")
1510+
totalIngressTLSHandshakeTimeMillis : Long("<num>"),
1511+
totalTimeForEgressConnectionAcquiredToWireMicros : Long("<num>")
15111512
},
15121513
operation : {
15131514
numConnectionNetworkTimeouts : Long("<num>"), // Added in MongoDB 6.2
@@ -5082,6 +5083,15 @@ transactions
50825083
server have to wait for the TLS network handshake to complete. The
50835084
number is cumulative and is the total after the server was started.
50845085

5086+
.. serverstatus:: metrics.network.totalTimeForEgressConnectionAcquiredToWireMicros
5087+
5088+
.. versionadded:: 6.2
5089+
5090+
The total time in microseconds that operations wait between
5091+
acquisition of a server connection and writing the bytes to send to
5092+
the server over the network. The number is cumulative and is the
5093+
total after the server was started.
5094+
50855095
.. serverstatus:: transactions.retriedCommandsCount
50865096

50875097
|mongod-only|

source/reference/parameters.txt

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,59 @@ General Parameters
11161116

11171117
db.adminCommand( { setParameter: 1, slowConnectionThresholdMillis: 250 } )
11181118

1119+
.. parameter:: connectionAcquisitionToWireLoggingRate
1120+
1121+
.. versionadded:: 6.2
1122+
1123+
*Default*: 0.2
1124+
1125+
|both|
1126+
1127+
Value must be between 0 and 1 inclusive.
1128+
1129+
The value determines when an event is added to the :ref:`log
1130+
<log-messages-ref>` for connection acquisitions. The event contains
1131+
the:
1132+
1133+
- Message ``"Acquired connection for remote operation and completed
1134+
writing to wire"``.
1135+
1136+
- Time in microseconds that the operation waited between acquisition
1137+
of a server connection and writing the bytes to send to the server
1138+
over the network.
1139+
1140+
If the time from connection acquisition to writing the bytes is:
1141+
1142+
- Greater than or equal to the internal time limit (for example, 1000
1143+
microseconds), the event is always added to the log.
1144+
1145+
- Less than the internal time limit, the event is added to the log
1146+
based on the :parameter:`connectionAcquisitionToWireLoggingRate`
1147+
setting. For example, if
1148+
:parameter:`connectionAcquisitionToWireLoggingRate` is set to:
1149+
1150+
- ``0``, the event is never logged.
1151+
1152+
- ``0.4``, the event is logged 40% of the time.
1153+
1154+
- ``0.9``, the event is logged 90% of the time.
1155+
1156+
- ``1.0``, the event is always logged.
1157+
1158+
The following example sets
1159+
:parameter:`connectionAcquisitionToWireLoggingRate` to ``0.4``.
1160+
1161+
.. code-block:: bash
1162+
1163+
mongod --setParameter connectionAcquisitionToWireLoggingRate=0.4
1164+
1165+
Or, if using the :dbcommand:`setParameter` command within
1166+
:binary:`~bin.mongosh`:
1167+
1168+
.. code-block:: javascript
1169+
1170+
db.adminCommand( { setParameter: 1, connectionAcquisitionToWireLoggingRate: 0.4 } )
1171+
11191172
.. parameter:: connPoolMaxConnsPerHost
11201173

11211174
*Default*: 200

source/release-notes/6.2.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Starting in MongoDB 6.2, the :dbcommand:`serverStatus` command and the
4040
- :serverstatus:`metrics.network.totalEgressConnectionEstablishmentTimeMillis`
4141
:serverstatus:`metrics.network.totalIngressTLSConnections`
4242
:serverstatus:`metrics.network.totalIngressTLSHandshakeTimeMillis`
43+
:serverstatus:`metrics.network.totalTimeForEgressConnectionAcquiredToWireMicros`
4344

4445
* - Additions to :serverstatus:`metrics.operation` document.
4546
- :serverstatus:`metrics.operation.numConnectionNetworkTimeouts`
@@ -71,10 +72,12 @@ Collection Validation Improvements
7172
Server Parameters
7273
-----------------
7374

74-
Starting in MongoDB 6.2, MongoDB adds the following new parameter:
75+
Starting in MongoDB 6.2, these server parameters were added:
7576

7677
- :parameter:`slowConnectionThresholdMillis` sets the time limit to log
7778
the establishment of slow server connections.
79+
- :parameter:`connectionAcquisitionToWireLoggingRate` determines when an
80+
event is added to the log for connection acquisitions.
7881

7982
Report an Issue
8083
---------------

0 commit comments

Comments
 (0)