Skip to content

Commit c29c238

Browse files
authored
DOCS-15854 Add cpuNanos to Linux (#2681)
* DOCS-15854 Add cpuNanos to Linux * version added + nanoseconds * LW feedback
1 parent 692d282 commit c29c238

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

source/reference/database-profiler.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,13 @@ operation.
653653
the :data:`~system.profile.responseLength` value is in a field
654654
named ``reslen``.
655655

656+
.. data:: system.profile.cpuNanos
657+
658+
.. versionadded:: 6.3
659+
660+
The total CPU time spent by a query operation in nanoseconds. This field is
661+
only available on Linux systems.
662+
656663
.. data:: system.profile.protocol
657664

658665
The :doc:`/reference/mongodb-wire-protocol` request message format.

source/reference/log-messages.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,13 +1010,19 @@ Starting in MongoDB 5.0, :ref:`slow operation
10101010
<database-profiling-specify-slowms-threshold>` log messages include a
10111011
``remote`` field specifying client IP address.
10121012

1013+
Starting in MongoDB 6.3, :ref:`slow operation
1014+
<database-profiling-specify-slowms-threshold>` log messages and :ref:`database
1015+
profiler <profiler>` entries include a ``cpuNanos`` field that specifies the
1016+
total CPU time spent by a query operation in nanoseconds. The ``cpuNanos`` field
1017+
is only available on Linux systems.
1018+
10131019
The following example output includes information about
10141020
a slow :doc:`aggregation </aggregation>` operation:
10151021

10161022
.. code-block:: javascript
10171023
:copyable: false
10181024

1019-
{"t":{"$date":"2020-05-20T20:10:08.731+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn281","msg":"Slow query","attr":{"type":"command","ns":"stocks.trades","appName":"MongoDB Shell","command":{"aggregate":"trades","pipeline":[{"$project":{"ticker":1.0,"price":1.0,"priceGTE110":{"$gte":["$price",110.0]},"_id":0.0}},{"$sort":{"price":-1.0}}],"allowDiskUse":true,"cursor":{},"lsid":{"id":{"$uuid":"fa658f9e-9cd6-42d4-b1c8-c9160fabf2a2"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1590005405,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"planSummary":"COLLSCAN","cursorid":1912190691485054730,"keysExamined":0,"docsExamined":1000001,"hasSortStage":true,"usedDisk":true,"numYields":1002,"nreturned":101,"reslen":17738,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":1119}},"Global":{"acquireCount":{"r":1119}},"Database":{"acquireCount":{"r":1119}},"Collection":{"acquireCount":{"r":1119}},"Mutex":{"acquireCount":{"r":117}}},"storage":{"data":{"bytesRead":232899899,"timeReadingMicros":186017},"timeWaitingMicros":{"cache":849}},"remote": "192.168.14.15:37666","protocol":"op_msg","durationMillis":22427}}
1025+
{"t":{"$date":"2020-05-20T20:10:08.731+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn281","msg":"Slow query","attr":{"type":"command","ns":"stocks.trades","appName":"MongoDB Shell","command":{"aggregate":"trades","pipeline":[{"$project":{"ticker":1.0,"price":1.0,"priceGTE110":{"$gte":["$price",110.0]},"_id":0.0}},{"$sort":{"price":-1.0}}],"allowDiskUse":true,"cursor":{},"lsid":{"id":{"$uuid":"fa658f9e-9cd6-42d4-b1c8-c9160fabf2a2"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1590005405,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"planSummary":"COLLSCAN","cursorid":1912190691485054730,"keysExamined":0,"docsExamined":1000001,"hasSortStage":true,"usedDisk":true,"numYields":1002,"nreturned":101,"reslen":17738,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":1119}},"Global":{"acquireCount":{"r":1119}},"Database":{"acquireCount":{"r":1119}},"Collection":{"acquireCount":{"r":1119}},"Mutex":{"acquireCount":{"r":117}}},"storage":{"data":{"bytesRead":232899899,"timeReadingMicros":186017},"timeWaitingMicros":{"cache":849}},"cpuNanos":22426151000,"remote": "192.168.14.15:37666","protocol":"op_msg","durationMillis":22427}}
10201026

10211027
See the :ref:`examples section <log-message-json-examples>` for a
10221028
:ref:`pretty-printed <log-message-pretty-printing>` version of this log
@@ -1453,6 +1459,7 @@ This example shows a :ref:`slow operation message
14531459
"cache": 849
14541460
}
14551461
},
1462+
"cpuNanos": 22426151000,
14561463
"remote": "192.168.14.15:37666",
14571464
"protocol": "op_msg",
14581465
"durationMillis": 22427

0 commit comments

Comments
 (0)