From 2cd9b783f98b0281a3f9812f4501a0fc297483ed Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Fri, 23 Jun 2023 17:46:30 -0300 Subject: [PATCH 1/3] Change SendPerformanceTiming to be a read so it is not retried and gets stuck in a loop --- src/libs/actions/Timing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Timing.js b/src/libs/actions/Timing.js index 0f6a67d0879e..1bc4decebd4b 100644 --- a/src/libs/actions/Timing.js +++ b/src/libs/actions/Timing.js @@ -51,11 +51,11 @@ function end(eventName, secondaryName = '') { return; } - API.write('SendPerformanceTiming', { + API.read('SendPerformanceTiming', { name: grafanaEventName, value: eventTime, platform: `${getPlatform()}`, - }); + }, {}); }); } From 2e598afdf654747228e48460a9f0deb51dafd502 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Fri, 23 Jun 2023 20:42:53 -0300 Subject: [PATCH 2/3] Prettier --- src/libs/actions/Timing.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/actions/Timing.js b/src/libs/actions/Timing.js index 1bc4decebd4b..5360a89d251b 100644 --- a/src/libs/actions/Timing.js +++ b/src/libs/actions/Timing.js @@ -46,16 +46,16 @@ function end(eventName, secondaryName = '') { console.debug(`Timing:${grafanaEventName}`, eventTime); delete timestampData[eventName]; - if (Environment.isDevelopment()) { - // Don't create traces on dev as this will mess up the accuracy of data in release builds of the app - return; - } + // if (Environment.isDevelopment()) { + // // Don't create traces on dev as this will mess up the accuracy of data in release builds of the app + // return; + // } - API.read('SendPerformanceTiming', { + API.write('SendPerformanceTiming', { name: grafanaEventName, value: eventTime, platform: `${getPlatform()}`, - }, {}); + }); }); } From 38756dd2ecd0e3a323043bb9d6f651532296edfc Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Fri, 23 Jun 2023 20:47:12 -0300 Subject: [PATCH 3/3] Pretttier --- src/libs/actions/Timing.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libs/actions/Timing.js b/src/libs/actions/Timing.js index 5360a89d251b..baaf666948ff 100644 --- a/src/libs/actions/Timing.js +++ b/src/libs/actions/Timing.js @@ -46,16 +46,20 @@ function end(eventName, secondaryName = '') { console.debug(`Timing:${grafanaEventName}`, eventTime); delete timestampData[eventName]; - // if (Environment.isDevelopment()) { - // // Don't create traces on dev as this will mess up the accuracy of data in release builds of the app - // return; - // } + if (Environment.isDevelopment()) { + // Don't create traces on dev as this will mess up the accuracy of data in release builds of the app + return; + } - API.write('SendPerformanceTiming', { - name: grafanaEventName, - value: eventTime, - platform: `${getPlatform()}`, - }); + API.read( + 'SendPerformanceTiming', + { + name: grafanaEventName, + value: eventTime, + platform: `${getPlatform()}`, + }, + {}, + ); }); }