aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-11-28 02:17:59 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-11-28 02:17:59 +0800
commit6e2523625f6a29bfcf58bf032d0cd3a468053247 (patch)
treea3b0169a1c17c59a499fb57f7587c6a90c143256 /packages/instant
parent7efa71eaf6767c9078fac5ef0122292da7419f1f (diff)
downloaddexon-sol-tools-6e2523625f6a29bfcf58bf032d0cd3a468053247.tar.gz
dexon-sol-tools-6e2523625f6a29bfcf58bf032d0cd3a468053247.tar.zst
dexon-sol-tools-6e2523625f6a29bfcf58bf032d0cd3a468053247.zip
feat(instant): change event properties to ms times instead of unix timestamps
Diffstat (limited to 'packages/instant')
-rw-r--r--packages/instant/src/util/analytics.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index d45d37b3b..c2fe7b0e7 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -133,23 +133,20 @@ export const analytics = {
trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({
...buyQuoteEventProperties(buyQuote),
txHash,
- startTimeUnix,
- expectedEndTimeUnix,
+ expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
}),
trackBuyTxSucceeded: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
trackingEventFnWithPayload(EventNames.BUY_TX_SUCCEEDED)({
...buyQuoteEventProperties(buyQuote),
txHash,
- startTimeUnix,
- expectedEndTimeUnix,
- actualEndTimeUnix: new Date().getTime(),
+ expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
+ actualTxTimeMs: new Date().getTime() - startTimeUnix,
}),
trackBuyTxFailed: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) =>
trackingEventFnWithPayload(EventNames.BUY_TX_FAILED)({
...buyQuoteEventProperties(buyQuote),
txHash,
- startTimeUnix,
- expectedEndTimeUnix,
- actualEndTimeUnix: new Date().getTime(),
+ expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix,
+ actualTxTimeMs: new Date().getTime() - startTimeUnix,
}),
};