feat(instant): change event properties to ms times instead of unix timestamps

This commit is contained in:
Brandon Millman
2018-11-27 10:17:59 -08:00
parent 7efa71eaf6
commit 6e2523625f

View File

@@ -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,
}),
};