Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3162

Don't call "RTTMonitor.Stats" on every operation

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • 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?

      Context

      Currently the Go driver calls RTTMonitor.Stats for every operation on both v1 and master. That call acquires a read lock and performs a series of calculations to get an RTT statistics summary to add to error messages. Ideally we shouldn't call that method on every operation.

      Definition of done

      • Change the Operation.Execute code to only call RTTMonitor.Stats when generating an error value, not on every request.
      • (Optional) Consider replacing the RTT values read on every request (e.g. EWMA, Min, P90, etc) with atomic.Value to avoid using an RWMutex (see GODRIVER-3094).

      Pitfalls

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: