-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DOCS-1474 moved collection statistics output into collStats #949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,9 @@ collStats | |
|
|
||
| .. default-domain:: mongodb | ||
|
|
||
| Definition | ||
| ---------- | ||
|
|
||
| .. dbcommand:: collStats | ||
|
|
||
| The :dbcommand:`collStats` command returns a variety of storage statistics | ||
|
|
@@ -47,6 +50,134 @@ collStats | |
| The scale factor rounds values to whole numbers. This can | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. potentially link above cross reference directly to this section. |
||
| produce unpredictable and unexpected results in some situations. | ||
|
|
||
| .. seealso:: ":doc:`/reference/collection-statistics`." | ||
| Output | ||
| ------ | ||
|
|
||
| .. data:: collStats.ns | ||
|
|
||
| The namespace of the current collection, which follows the format | ||
| ``[database].[collection]``. | ||
|
|
||
| .. data:: collStats.count | ||
|
|
||
| The number of objects or documents in this collection. | ||
|
|
||
| .. data:: collStats.size | ||
|
|
||
| The size of the data stored in this collection. This value does not | ||
| include the size of any indexes associated with the collection, | ||
| which the :data:`~collStats.totalIndexSize` field reports. | ||
|
|
||
| The ``scale`` argument affects this value. | ||
|
|
||
| .. data:: collStats.avgObjSize | ||
|
|
||
| The average size of an object in the collection. The ``scale`` | ||
| argument affects this value. | ||
|
|
||
| .. data:: collStats.storageSize | ||
|
|
||
| The total amount of storage allocated to this collection for | ||
| :term:`document` storage. The ``scale`` argument affects this | ||
| value. The :data:`~collStats.storageSize` does not decrease as you remove or | ||
| shrink documents. | ||
|
|
||
| .. sum of all extents (no indexes or the $freelist) | ||
| .. include links to eventual documentation of storage management | ||
|
|
||
| .. data:: collStats.numExtents | ||
|
|
||
| The total number of contiguously allocated data file regions. | ||
|
|
||
| .. data:: collStats.nindexes | ||
|
|
||
| The number of indexes on the collection. All collections have at | ||
| least one index on the :term:`_id` field. | ||
|
|
||
| .. versionchanged:: 2.2 | ||
| Before 2.2, capped collections did not necessarily have an | ||
| index on the ``_id`` field, and some capped collections created | ||
| with pre-2.2 versions of :program:`mongod` may not have an | ||
| ``_id`` index. | ||
|
|
||
|
|
||
| .. data:: collStats.lastExtentSize | ||
|
|
||
| The size of the last extent allocated. The ``scale`` argument | ||
| affects this value. | ||
|
|
||
| .. data:: collStats.paddingFactor | ||
|
|
||
| The amount of space added to the end of each document at insert | ||
| time. The document padding provides a small amount of extra space | ||
| on disk to allow a document to grow slightly without needing to | ||
| move the document. :program:`mongod` automatically calculates this | ||
| padding factor | ||
|
|
||
| .. data:: collStats.flags | ||
|
|
||
| .. versionchanged:: 2.2 | ||
| Removed in version 2.2 and replaced with the :data:`~collStats.userFlags` | ||
| and :data:`~collStats.systemFlags` fields. | ||
|
|
||
| Indicates the number of flags on the current collection. In version | ||
| 2.0, the only flag notes the existence of an :term:`index` on the | ||
| :term:`_id` field. | ||
|
|
||
| .. data:: collStats.systemFlags | ||
|
|
||
| .. versionadded:: 2.2 | ||
|
|
||
| Reports the flags on this collection that reflect internal server | ||
| options. Typically this value is ``1`` and reflects the existence | ||
| of an :term:`index` on the ``_id`` field. | ||
|
|
||
| .. data:: collStats.userFlags | ||
|
|
||
| .. versionadded:: 2.2 | ||
|
|
||
| Reports the flags on this collection set by the user. In version | ||
| 2.2 the only user flag is :collflag:`usePowerOf2Sizes`. | ||
| If :collflag:`usePowerOf2Sizes` is enabled, :data:`~collStats.userFlags` will | ||
| be set to ``1``, otherwise :data:`~collStats.userFlags` will be ``0``. | ||
|
|
||
| See the :dbcommand:`collMod` command for more information on setting user | ||
| flags and :collflag:`usePowerOf2Sizes`. | ||
|
|
||
| .. data:: collStats.totalIndexSize | ||
|
|
||
| The total size of all indexes. The ``scale`` argument affects this | ||
| value. | ||
|
|
||
| .. data:: collStats.indexSizes | ||
|
|
||
| This field specifies the key and size of every existing index on | ||
| the collection. The ``scale`` argument affects this value. | ||
|
|
||
| Example | ||
| ------- | ||
|
|
||
| The following is an example of :method:`db.collection.stats()` and | ||
| :dbcommand:`collStats` output: | ||
|
|
||
| .. code-block:: javascript | ||
|
|
||
| .. read-lock | ||
| { | ||
| "ns" : "<database>.<collection>", | ||
| "count" : <number>, | ||
| "size" : <number>, | ||
| "avgObjSize" : <number>, | ||
| "storageSize" : <number>, | ||
| "numExtents" : <number>, | ||
| "nindexes" : <number>, | ||
| "lastExtentSize" : <number>, | ||
| "paddingFactor" : <number>, | ||
| "systemFlags" : <bit>, | ||
| "userFlags" : <bit>, | ||
| "totalIndexSize" : <number>, | ||
| "indexSizes" : { | ||
| "_id_" : <number>, | ||
| "a_1" : <number> | ||
| }, | ||
| "ok" : 1 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be cross reference.