Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1985

Server::getLatency() should return null if unset

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.11.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Since load balancers do not utilize SDAM, RTT will never be calculated. The return value from mongoc_server_description_round_trip_time will be -1, which indicates "unset" (see: CDRIVER-4176).

      Returning null in this case may be the most sensible API, but if there is a BC concern we could always return -1 instead. If we do change this method to return null for an unset value, we should also update php_phongo_server_to_zval (called by php_phongo_server_get_debug_info) and ensure the "round_trip_time" field is reported consistently.

      Server::getLatency() is currently only tested for replica sets (tests/replicaset/server-001.phpt), so we should consider adding more test coverage when addressing this issue.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: