Skip to content

Commit 02c66fd

Browse files
author
Dave
authored
DOCS-14398 log time spent in slow queries v5.3 (#644)
* DOCS-14398 Log time waiting for authorization locks * log messages page * Staging tweaks * Review feedback * Review feedback * Review feedback
1 parent 14383e8 commit 02c66fd

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

source/reference/database-profiler.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,34 @@ operation.
519519
For more information on lock modes, see
520520
:ref:`faq-concurrency-locking`.
521521

522+
.. data:: system.profile.authorization
523+
524+
.. versionadded:: 5.0.0
525+
526+
The number of times the user cache is accessed for each operation.
527+
These metrics are only displayed when an operation has accessed the
528+
user cache at least once.
529+
530+
These metrics are only available when :ref:`slow operation logging
531+
<log-message-slow-ops>` or :ref:`database profiling <profiler>` is
532+
enabled.
533+
534+
:data:`system.profile.authorization` is not included in
535+
:method:`db.currentOp()` output.
536+
537+
.. data:: system.profile.authorization.startedUserCacheAcquisitionAttempts
538+
539+
The number of times the operation tried to access the user cache.
540+
541+
.. data:: system.profile.authorization.completedUserCacheAcquisitionAttempts
542+
543+
The number of times the operation retrieved user data from the
544+
user cache.
545+
546+
.. data:: system.profile.authorization.userCacheWaitTimeMicros
547+
548+
The total time the operation spent waiting for user cache
549+
responses.
522550

523551
.. data:: system.profile.storage
524552

source/reference/log-messages.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,3 +1414,22 @@ The following example log message contains a ``resolvedViews`` field for
14141414
}
14151415
}
14161416
}
1417+
1418+
Authorization
1419+
~~~~~~~~~~~~~
1420+
1421+
Starting in MongoDB 5.0, :ref:`log messages for slow queries
1422+
<log-message-slow-ops>` include a
1423+
:data:`system.profile.authorization` section. These metrics help
1424+
determine if a request is delayed because of contention for the user
1425+
authorization cache.
1426+
1427+
.. code-block:: javascript
1428+
:copyable: false
1429+
1430+
"authorization": {
1431+
"startedUserCacheAcquisitionAttempts": 1,
1432+
"completedUserCacheAcquisitionAttempts": 1,
1433+
"userCacheWaitTimeMicros": 508
1434+
},
1435+

0 commit comments

Comments
 (0)