Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5854

Logger Instantiation and willLog Perf Improvement

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 6.4.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a... user using the Node Driver
      I want... the logger to only be instantiated for components for which it is turned on, and want willLog checks to be quick
      So that... the driver can not be slowed down if logging isn't turned on

      User Impact

      • This will make the driver performance less affected by the logger to users

      Acceptance Criteria

      Implementation Requirements

      • Only instantiate the logger if all component severities are NOT set to 'off' after MongoLogger.resolveOptions(loggerEnvOptions, loggerClientOptions))
      • Make MongoLogger variable optionally null in connection and topology class 
      • Precompute willLog (severity levels and components) so a mongoLogger getter can access them, quicker than willLog as function call
      • in MongoLogger.turnOffSeverties(), set all precomputed willLog entries to false

       

      Testing Requirements 

      • Unit test to check mongo logger is not instantiated if severity levels are set to 'off'
      • Unit test new memoized WillLog (severity level and component) variable
      • Ensure all existing tests pass

       

       

            Assignee:
            aditi.khare@mongodb.com Aditi Khare
            Reporter:
            aditi.khare@mongodb.com Aditi Khare
            Alena Khineika, Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: