|
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();
|