Skip to content

Commit 17a7967

Browse files
author
Dave
authored
DOCS-14398 BACKPORT (#693)
1 parent a2b88ba commit 17a7967

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
@@ -517,6 +517,34 @@ operation.
517517
For more information on lock modes, see
518518
:ref:`faq-concurrency-locking`.
519519

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

521549
.. data:: system.profile.storage
522550

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)