Skip to content

Commit f1c8c4b

Browse files
committed
DOCS-14455 Add references for numHosts targeted in shardingStatistics
1 parent a6bd836 commit f1c8c4b

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. list-table::
2+
:header-rows: 1
3+
:widths: 20 40
4+
5+
* - Name
6+
- Description
7+
8+
* - ``allShards``
9+
- A command targeted all shards
10+
11+
* - ``manyShards``
12+
- A command targeted more than one shard
13+
14+
* - ``oneShard``
15+
- A command targeted one shard
16+
17+
* - ``unsharded``
18+
- A command was run on an unsharded collection

source/reference/command/serverStatus.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,6 +2774,39 @@ shardingStatistics
27742774
.. code-block:: javascript
27752775

27762776
"shardingStatistics" : {
2777+
"numHostsTargeted": {
2778+
"find" : {
2779+
"allShards": NumberLong(<num>),
2780+
"manyShards": NumberLong(<num>),
2781+
"oneShard": NumberLong(<num>),
2782+
"unsharded": NumberLong(<num>)
2783+
},
2784+
"insert": {
2785+
"allShards": NumberLong(<num>),
2786+
"manyShards": NumberLong(<num>),
2787+
"oneShard": NumberLong(<num>),
2788+
"unsharded": NumberLong(<num>)
2789+
},
2790+
"update": {
2791+
"allShards": NumberLong(<num>),
2792+
"manyShards": NumberLong(<num>),
2793+
"oneShard": NumberLong(<num>),
2794+
"unsharded": NumberLong(<num>)
2795+
},
2796+
"delete": {
2797+
"allShards": NumberLong(<num>),
2798+
"manyShards": NumberLong(<num>),
2799+
"oneShard": NumberLong(<num>),
2800+
"unsharded": NumberLong(<num>)
2801+
},
2802+
"aggregate": {
2803+
"allShards": NumberLong(<num>),
2804+
"manyShards": NumberLong(<num>),
2805+
"oneShard": NumberLong(<num>),
2806+
"unsharded": NumberLong(<num>)
2807+
}
2808+
}
2809+
},
27772810
"catalogCache" : {
27782811
"numDatabaseEntries" : NumberLong(<num>),
27792812
"numCollectionEntries" : NumberLong(<num>),
@@ -3364,6 +3397,28 @@ shardingStatistics
33643397

33653398
.. versionadded:: 5.0
33663399

3400+
.. serverstatus:: shardingStatistics.numHostsTargeted
3401+
3402+
Indicates the number of shards targeted for ``CRUD`` operations and
3403+
aggregation commands. When a ``CRUD`` operation or aggregation
3404+
command is run, the following metrics will be incremented.
3405+
3406+
.. include:: /includes/fact-server-status-num-hosts-targeted.rst
3407+
3408+
.. note:: Running the :dbcommand:`serverStatus` on :binary:`mongos`
3409+
will provide insight into the aggregation operations find,
3410+
insert, update, delete and aggregate that run on a sharded
3411+
cluster.
3412+
3413+
Multi-shard operations can either be
3414+
:ref:`scatter-gather<sharding-query-patterns>`
3415+
or shard specific. Multi-shard scatter-gather operations can
3416+
:ref:`consume more resources<sharding-troubleshooting-scatter-gather>`,
3417+
by using the
3418+
:serverstatus:`shardingStatistics.numHostsTargeted`
3419+
metrics you can tune the aggregation queries that run on a
3420+
sharded cluster.
3421+
33673422
.. serverstatus:: shardingStatistics.resharding.coordinatorState
33683423

33693424
State of the resharding coordinator for the current :ref:`resharding

source/release-notes/4.4.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,18 @@ output:
19151915
- :serverstatus:`shardedIndexConsistency`
19161916
- :serverstatus:`shardingStatistics.rangeDeleterTasks`
19171917
- :serverstatus:`shardingStatistics.unfinishedMigrationFromPreviousPrimary`
1918+
- :serverstatus:`shardingStatistics.numHostsTargeted`
1919+
1920+
``serverStatus`` Sharding Statistics Output Change
1921+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1922+
1923+
CRUD Operations and Aggregations
1924+
1925+
:serverstatus:`shardingStatistics.numHostsTargeted`
1926+
which reports the number of shards targeted by CRUD operations and
1927+
aggregation commands. The relevant find, insert, update, delete or
1928+
aggregate metric will be incremented with each operation on a
1929+
cluster.
19181930

19191931
``replSetGetStatus`` Output Change
19201932
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)