From 92ca5edaea0bab857caed0abaf42d8dadabeace8 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Mon, 23 Oct 2023 09:14:56 -0700 Subject: [PATCH] Track number of loaded plugins Reviewed By: lblasa Differential Revision: D50556872 fbshipit-source-id: 2d841360f7081074afa025d0bad8c41d7b2db16e --- desktop/flipper-ui-core/src/startFlipperDesktop.tsx | 6 +++++- desktop/flipper-ui-core/src/utils/UIPerfTracker.tsx | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/desktop/flipper-ui-core/src/startFlipperDesktop.tsx b/desktop/flipper-ui-core/src/startFlipperDesktop.tsx index 7be42ec0f..a8041b5d8 100644 --- a/desktop/flipper-ui-core/src/startFlipperDesktop.tsx +++ b/desktop/flipper-ui-core/src/startFlipperDesktop.tsx @@ -162,7 +162,11 @@ function init(flipperServer: FlipperServer) { // We could potentially merge ui-perf-store-rehydrated and ui-perf-everything-finally-loaded-jeeeez, // but what if at some point in the future we relalize that store rehydration is not actually the last event? // Keep it separate for the time being (evil laugh as there is nothing more permanent than temporary stuff) - uiPerfTracker.track('ui-perf-everything-finally-loaded-jeeeez'); + uiPerfTracker.track('ui-perf-everything-finally-loaded-jeeeez', { + numberOfPlugins: + store.getState().plugins.clientPlugins.size + + store.getState().plugins.devicePlugins.size, + }); }); setPersistor(persistor); diff --git a/desktop/flipper-ui-core/src/utils/UIPerfTracker.tsx b/desktop/flipper-ui-core/src/utils/UIPerfTracker.tsx index 1da3db5d3..423802e24 100644 --- a/desktop/flipper-ui-core/src/utils/UIPerfTracker.tsx +++ b/desktop/flipper-ui-core/src/utils/UIPerfTracker.tsx @@ -22,10 +22,11 @@ class UIPerfTracker { this.t0 = performance.now(); } - track(event: UIPerfEvents) { + track(event: UIPerfEvents, data?: any) { const tx = performance.now(); getLogger().track('performance', event, { time: tx - this.t0, + data, }); } }