Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15659

Make MockStage return actual mock stats

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc0
    • Affects Version/s: 2.7.7
    • Component/s: Querying
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

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

            Assignee:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: