[SERVER-7382] Track counters for each command Created: 17/Oct/12  Updated: 27/Oct/15  Resolved: 25/Sep/14

Status: Closed
Project: Core Server
Component/s: Admin, Internal Code
Affects Version/s: None
Fix Version/s: 2.7.7

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: David Hows
Resolution: Done Votes: 2
Labels: community-team, pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-12323 findAndModify not counted properly in... Closed
is duplicated by SERVER-12172 Add finer granularity metrics for ser... Closed
Related
related to SERVER-5828 Metric/Stats Tracking Closed
related to SERVER-15870 suppress uncalled commands from db.se... Closed
is related to DOCS-4323 Document command counters functionality Closed
is related to SERVER-5787 Track opcounters (insert/delete/updat... Closed
Backwards Compatibility: Minor Change
Sprint: Server 2.7.4, Server 2.7.5, Server 2.7.6
Participants:

 Description   

For each command we should track a counter, like opcounters in serverStatus and a gauge for the active/waiting operations by command type.

This will provide a counter for each command showing the number of times it has been executed and the number of times that the execution has failed. It will also track the number of times any unknown/invalid command is executed.

This will track writes that are issued via the write command syntax. Due to this the values between the already existing command counter and the new counters may be off.

Example shell usage:

> db.serverStatus().metrics.commands
{
        "<UNKNOWN>" : NumberLong(0),
        "_getUserCacheGeneration" : {
                "failed" : NumberLong(0),
                "total" : NumberLong(0)
        },
        "_isSelf" : {
                "failed" : NumberLong(0),
                "total" : NumberLong(0)
        },
        "_mergeAuthzCollections" : {
                "failed" : NumberLong(0),
                "total" : NumberLong(0)
        },
        "_migrateClone" : {
                "failed" : NumberLong(0),
                "total" : NumberLong(0)
        },
        "_recvChunkAbort" : {
                "failed" : NumberLong(0),
                "total" : NumberLong(0)
        },
...
}



 Comments   
Comment by Githook User [ 25/Sep/14 ]

Author:

{u'username': u'daveh86', u'name': u'daveh86', u'email': u'howsdav@gmail.com'}

Message: SERVER-7382 command counters

Closes #794

Signed-off-by: Benety Goh <benety@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/b2ea63e14f6e382c42409c8bf6326115fca94888

Comment by Scott Hernandez (Inactive) [ 24/Sep/14 ]

David, Please update the title/summary here with correct information, examples, etc. before closing.

Also note that "write commands" (insert/update/delete) are tracked and that the command counts under the new section might not match the other totals in opcounters due to this and other exceptions.

Comment by Ruslan Udovichenko [ 08/Aug/14 ]

1

Generated at Thu Feb 08 03:14:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.