[SERVER-30746] Include op counter statistics in collStats. Created: 18/Aug/17  Updated: 27/Oct/23  Resolved: 10/Aug/20

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 3.2.16, 3.4.7, 3.5.11
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Andrew Young Assignee: Katya Kamenieva
Resolution: Gone away Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:
Case:

 Description   

The op counters provided in serverStatus are not calculated in the same way as the values returned by the top command. This means that it is not currently possible to find values for per-collection op counters that align with the server level op counters returned by serverStatus. It would be nice if per-collection op counter could be collected in the same way as those returned by serverStatus so that the values could be compared to one another. The best place to store and return such statistics is probably the collStats command, as returning the data as part of serverStatus would potentially produce a large increase in the size of the data returned.



 Comments   
Comment by Katya Kamenieva [ 10/Aug/20 ]

Closing according to Asya's comment above

Comment by Asya Kamsky [ 07/Dec/17 ]

$collStats allows getting back reads, writes and commands for each collection. It also supports histograms of latencies along with counts. Output would be something like this:

{ "ns" : "test.matrices",
  "host" : mongo.example.net:27017",
  "localTime" : ISODate("2017-10-06T19:43:56.599Z"),
  "latencyStats" :
    { "reads" :
        { "histogram" : [
            { "micros" : NumberLong(16),
              "count" : NumberLong(3) },
            { "micros" : NumberLong(32),
              "count" : NumberLong(1) },
            { "micros" : NumberLong(128),
              "count" : NumberLong(1) } ],
          "latency" : NumberLong(264),
          "ops" : NumberLong(5) },
      "writes" :
        { "histogram" : [
            { "micros" : NumberLong(32),
              "count" : NumberLong(1) },
            { "micros" : NumberLong(64),
              "count" : NumberLong(3) },
            { "micros" : NumberLong(24576),
              "count" : NumberLong(1) } ],
          "latency" : NumberLong(27659),
          "ops" : NumberLong(5) },
      "commands" :
        { "histogram" : [ ],
          "latency" : NumberLong(0),
          "ops" : NumberLong(0) }
    }
}

This is new as of 3.4. Would that satisfy the per-collection requirement?

Generated at Thu Feb 08 04:24:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.