braintree / braintree_android

Braintree SDK for Android
https://developer.paypal.com/braintree/docs/start/hello-client/android/v4
MIT License
407 stars 233 forks source link

[QL] Measure API Request Latency #1032

Closed richherrera closed 3 months ago

richherrera commented 4 months ago

Summary of changes

Previously, SynchronousHttpClient returned the body of the response. However, this is where we are now obtaining start_time and end_time to analyze the response time of the services. This led to the creation of the HttpResponse object. This object is sent in the new NetworkResponseCallback callback.

The previous HttpResponseCallback callback was sent from BraintreeHttpClient to the clients (i.e. PayPalClient). By creating a new callback with the HttpResponse object, we avoid making any changes at the payment method client level.

In the BraintreeClient, we receive the NetworkResponseCallback callback from HttpClient, send the necessary event, and return the required information with the original HttpResponseCallback callback.

Before Now
Screenshot 2024-06-18 at 3 31 53 p m Screenshot 2024-06-18 at 3 32 00 p m

Screenshot 2024-06-12 at 11 14 10 a m

Checklist

Authors