[SERVER-12425] Provide resource accounting for every operation Created: 22/Jan/14  Updated: 06/Dec/22  Resolved: 19/Feb/19

Status: Closed
Project: Core Server
Component/s: Admin, Storage, Usability
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: quota, resources
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Storage Execution
Participants:

 Description   

For every operation/command report resources used, like other stats from the operation.

In addition to reporting it back inline also provide a record and the ability to collect it out-of-band from the operation itself (like in the profile collection).

A good example of this would be to account for storage during write operations:

db.b.update({}, {$set:{a:1}})
Update WriteResult({
	"ok" : 1,
	"nModified" : 12,
	"n" : 12,
	"resourcesUsed" : {cpu: 1000, storage:{collection:136, indexes:42}, memory:56000}, // cpu units = cycles?, storage/mem bytes
	"lastOp" : Timestamp(1389888187, 1),
	"writeErrors" : [
	]
})
// Remove frees space and results in negative storage
db.b.remove({a:1})
Remove WriteResult({
	"ok" : 1,
	"n" : 12,
	"resourcesUsed" : {cpu: 988, storage:{collection:-234234, indexes:-42234}, memory:16000000}, 
	"lastOp" : Timestamp(1389888187, 1),
	"writeErrors" : [
	]
})



 Comments   
Comment by Eric Milkie [ 19/Feb/19 ]

We've added some per-operation statistics in version 4.2, which accomplished part of the spirit of this ticket.  Unfortunately, more finer-grained resource measurements are incompatible with some of our longer term goals for performance improvements.

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