[SERVER-15659] Make MockStage return actual mock stats Created: 14/Oct/14  Updated: 11/Jul/16  Resolved: 29/Oct/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.7.7
Fix Version/s: 2.8.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Samantha Ritter (Inactive)
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Currently, MockStage::getStats() returns NULL. This behavior can break unrelated things. Since this stage provides a getCommonStats() method (which will also just return NULL) it would be useful if this stage could just keep around a dummy CommonStats object and use it to generate dummy PlanStageStats objects, something along the lines of:

 
// add a private class member
CommonStats _commonStats;
 
// in constructor
 _commonStats("MOCK_STAGE");
 
// replace the current getCommonStats()
const CommonStats* getCommonStats() {
     return &_commonStats;
}
 
// replace the current getStats()
const PlanStageStats* MockStage::getStats() {
     return new PlanStageStats(_commonStats, STAGE_MOCK));
}
 

The same is true of MockStage::getSpecificStats();



 Comments   
Comment by Githook User [ 29/Oct/14 ]

Author:

{u'username': u'samantharitter', u'name': u'Samantha Ritter', u'email': u'samantha.ritter@10gen.com'}

Message: SERVER-15659 make MockStage return actual mock stats
Branch: master
https://github.com/mongodb/mongo/commit/205756215a42aa6abf8caca6577e4148833b50c5

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