@@ -2435,6 +2435,39 @@ shardingStatistics
2435
2435
.. code-block:: javascript
2436
2436
2437
2437
"shardingStatistics" : {
2438
+ "numHostsTargeted": {
2439
+ "find" : {
2440
+ "allShards": NumberLong(<num>),
2441
+ "manyShards": NumberLong(<num>),
2442
+ "oneShard": NumberLong(<num>),
2443
+ "unsharded": NumberLong(<num>)
2444
+ },
2445
+ "insert": {
2446
+ "allShards": NumberLong(<num>),
2447
+ "manyShards": NumberLong(<num>),
2448
+ "oneShard": NumberLong(<num>),
2449
+ "unsharded": NumberLong(<num>)
2450
+ },
2451
+ "update": {
2452
+ "allShards": NumberLong(<num>),
2453
+ "manyShards": NumberLong(<num>),
2454
+ "oneShard": NumberLong(<num>),
2455
+ "unsharded": NumberLong(<num>)
2456
+ },
2457
+ "delete": {
2458
+ "allShards": NumberLong(<num>),
2459
+ "manyShards": NumberLong(<num>),
2460
+ "oneShard": NumberLong(<num>),
2461
+ "unsharded": NumberLong(<num>)
2462
+ },
2463
+ "aggregate": {
2464
+ "allShards": NumberLong(<num>),
2465
+ "manyShards": NumberLong(<num>),
2466
+ "oneShard": NumberLong(<num>),
2467
+ "unsharded": NumberLong(<num>)
2468
+ }
2469
+ }
2470
+ },
2438
2471
"catalogCache" : {
2439
2472
"numDatabaseEntries" : NumberLong(<num>),
2440
2473
"numCollectionEntries" : NumberLong(<num>),
@@ -2709,8 +2742,28 @@ shardingStatistics
2709
2742
Only present when run on a :binary:`~bin.mongos`.
2710
2743
2711
2744
.. versionadded:: 4.2.7
2712
-
2713
- .. _server-status-sharded-index-consistency:
2745
+
2746
+ .. serverstatus:: shardingStatistics.numHostsTargeted
2747
+
2748
+ Indicates the number of shards targeted for ``CRUD`` operations and
2749
+ aggregation commands. When a ``CRUD`` operation or aggregation
2750
+ command is run, the following metrics will be incremented.
2751
+
2752
+ .. include:: /includes/fact-server-status-num-hosts-targeted.rst
2753
+
2754
+ .. note:: Running the :dbcommand:`serverStatus` on :binary:`mongos`
2755
+ will provide insight into the aggregation operations find,
2756
+ insert, update, delete and aggregate that run on a sharded
2757
+ cluster.
2758
+
2759
+ Multi-shard operations can either be
2760
+ :ref:`scatter-gather<sharding-query-patterns>`
2761
+ or shard specific. Multi-shard scatter-gather operations can
2762
+ :ref:`consume more resources<sharding-troubleshooting-scatter-gather>`,
2763
+ by using the
2764
+ :serverstatus:`shardingStatistics.numHostsTargeted`
2765
+ metrics you can tune the aggregation queries that run on a
2766
+ sharded cluster.
2714
2767
2715
2768
shardedIndexConsistency
2716
2769
~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments