-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QL] Measure API Request Latency (#1032)
* Add Analytics event for network latency * Add BTHTTPResponse to share start and end time * Return new class instead of String on synchronous call * Rename BTHTTPResponse to BTHttpResponse * Add new Response interface and NoResponse callback to pass start and end time * Change return type with new class name * Change response callback HttpResponseCallback with BTHttpResponseCallback to catch BTResponse object * Add sendAnalitycsEvent call on onResult call back * Update analytics event class and database * Add endpoint, start and end time keys to use on AnalyticsClient * Move event timestamp property, add parameters on sendAnalytics method * Send Network latency Analytics events after perform a request * Linting * Remove prints * Fix lints * Fix lints * Fix lint * Migrate previous class created on java to kt * Add Timming interface * Pass interface to ConfigurationLoader fromm BraintreeClient to send event * Fix AnalyticsClient UTs * Fix ConfigurationLoader UTs * Update Configuration loader path sent on Analytics * Update VisaCheckoutClient with new parameters * Fix VisaCheckoutClientTests * Fix Analytics Event parameter setup * Fix PayPalNativeCheckoutClient sendEvent params * Fix lints * Rename BTAPITiming interface * Update BTHttpResponseCallback interface * Fix UTs * Fix UTs * Fix lint * Add default AnalyticsEventParams values for kotlin instantiation * Fix lints * Fix lint identation * Use lambda on callbacks * Add test * Fix name event * Make nullable long analytics parameters * Rename BTHTTPResponse to HttpTimingResponse * Rename interface BTAPITiming to APITiming * Made long parameter nullable * Rename BTHTTPResponseCallback to HttpTimingResponse * Fix tests * Rename HttpTimingResponse with HttpResponse * Stripping out the merchants * Get mutation name * Update docstrings * Introduce HttpResponseTiming to project. * Delete unnecessary classes * Make optional callback * Fix UTs * Delete unnecessary interface * Fix lints * Rename interface HttpTimingResponseCallback to NetworkResponseCallback * Refactor sendGraphQLPostRequest in BraintreeClient to take a JSONObject instead of an optional. * Fix tests * Remove unnecessary method * Address PR comment --------- Co-authored-by: sshropshire <sshropshire@paypal.com>
- Loading branch information
1 parent
12fbf83
commit c3ed1be
Showing
31 changed files
with
408 additions
and
176 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
BraintreeCore/schemas/com.braintreepayments.api.AnalyticsDatabase/6.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"formatVersion": 1, | ||
"database": { | ||
"version": 6, | ||
"identityHash": "a1fb75547e5dd4f48e64a0534e726dcf", | ||
"entities": [ | ||
{ | ||
"tableName": "analytics_event", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `paypal_context_id` TEXT, `link_type` TEXT, `venmo_installed` INTEGER NOT NULL DEFAULT 0, `is_vault` INTEGER NOT NULL DEFAULT 0, `start_time` INTEGER DEFAULT -1, `end_time` INTEGER DEFAULT -1, `endpoint` TEXT, `timestamp` INTEGER NOT NULL, `_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)", | ||
"fields": [ | ||
{ | ||
"fieldPath": "name", | ||
"columnName": "name", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "payPalContextId", | ||
"columnName": "paypal_context_id", | ||
"affinity": "TEXT", | ||
"notNull": false | ||
}, | ||
{ | ||
"fieldPath": "linkType", | ||
"columnName": "link_type", | ||
"affinity": "TEXT", | ||
"notNull": false | ||
}, | ||
{ | ||
"fieldPath": "venmoInstalled", | ||
"columnName": "venmo_installed", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "isVaultRequest", | ||
"columnName": "is_vault", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "startTime", | ||
"columnName": "start_time", | ||
"affinity": "INTEGER", | ||
"notNull": false, | ||
"defaultValue": "-1" | ||
}, | ||
{ | ||
"fieldPath": "endTime", | ||
"columnName": "end_time", | ||
"affinity": "INTEGER", | ||
"notNull": false, | ||
"defaultValue": "-1" | ||
}, | ||
{ | ||
"fieldPath": "endpoint", | ||
"columnName": "endpoint", | ||
"affinity": "TEXT", | ||
"notNull": false | ||
}, | ||
{ | ||
"fieldPath": "timestamp", | ||
"columnName": "timestamp", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "id", | ||
"columnName": "_id", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"columnNames": [ | ||
"_id" | ||
], | ||
"autoGenerate": true | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
} | ||
], | ||
"views": [], | ||
"setupQueries": [ | ||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a1fb75547e5dd4f48e64a0534e726dcf')" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.