Server::getLatency() should return null if unset

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 1.11.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • 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:
              Jeremy Mikola
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: