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

Make MockStage return actual mock stats

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.8.0-rc0
    • 2.7.7
    • Querying

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: