Skip to content

Commit 11ff391

Browse files
committed
fix: sidebar_loaded end event trigger & docs
1 parent 216db09 commit 11ff391

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

contributingGuides/PERFORMANCE_METRICS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Project is using Firebase for tracking these metrics. However, not all of them a
1414
| `js_loaded` || The time it takes for the JavaScript bundle to load. <br><br>**Platforms:** Android, iOS | **Android:** Starts in the `onCreate` method.<br><br>**iOS:** Starts in the AppDelegate's `didFinishLaunchingWithOptions` method. | Stops at the first render of the app via native module on the JS side. |
1515
| `_app_in_foreground` || The time when the app is running in the foreground and available to the user.<br><br>**Platforms:** Android, iOS | **Android:** Starts when the first activity to reach the foreground has its `onResume()` method called. <br><br>**iOS:** Starts when the application receives the `UIApplicationDidBecomeActiveNotification` notification. | **Android:** Stops when the last activity to leave the foreground has its `onStop()` method called. <br><br>**iOS:** Stops when it receives the `UIApplicationWillResignActiveNotification` notification. |
1616
| `_app_in_background` || Time when the app is running in the background.<br><br>**Platforms:** Android, iOS | **Android:** Starts when the last activity to leave the foreground has its `onStop()` method called. <br><br>**iOS:** Starts when the application receives the `UIApplicationWillResignActiveNotification` notification. | **Android:** Stops when the first activity to reach the foreground has its `onResume()` method called. <br><br>**iOS:** Stops when it receives the `UIApplicationDidBecomeActiveNotification` notification. |
17-
| `sidebar_loaded` || Time taken for the Sidebar to load.<br><br>**Platforms:** All | Starts when the Sidebar is mounted. | Stops when the Splash Screen is hidden. |
17+
| `sidebar_loaded` || Time taken for the Sidebar to load.<br><br>**Platforms:** All | Starts when the Sidebar is mounted. | Stops when the LHN finishes laying out. |
1818
| `calc_most_recent_last_modified_action` || Time taken to find the most recently modified report action or report.<br><br>**Platforms:** All | Starts when the app reconnects to the network | Ends when the app reconnects to the network and the most recent report action or report is found. |
1919
| `open_search` || Time taken to open up the Search Router.<br><br>**Platforms:** All | Starts when the Search Router icon in LHN is pressed. | Stops when the list of available options finishes laying out. |
2020
| `load_search_options` || Time taken to generate the list of options used in the Search Router.<br><br>**Platforms:** All | Starts when the `getSearchOptions` function is called. | Stops when the list of available options is generated. |

src/Expensify.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import NavigationRoot from './libs/Navigation/NavigationRoot';
3030
import NetworkConnection from './libs/NetworkConnection';
3131
import PushNotification from './libs/Notification/PushNotification';
3232
import './libs/Notification/PushNotification/subscribePushNotification';
33-
import Performance from './libs/Performance';
3433
import setCrashlyticsUserId from './libs/setCrashlyticsUserId';
3534
import StartupTimer from './libs/StartupTimer';
3635
// This lib needs to be imported, but it has nothing to export since all it contains is an Onyx connection
@@ -138,7 +137,6 @@ function Expensify() {
138137

139138
const onSplashHide = useCallback(() => {
140139
setSplashScreenState(CONST.BOOT_SPLASH_STATE.HIDDEN);
141-
Performance.markEnd(CONST.TIMING.SIDEBAR_LOADED);
142140
}, [setSplashScreenState]);
143141

144142
useLayoutEffect(() => {

src/libs/actions/App.ts

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {buildEmojisTrie} from '@libs/EmojiTrie';
1414
import Log from '@libs/Log';
1515
import getCurrentUrl from '@libs/Navigation/currentUrl';
1616
import Navigation from '@libs/Navigation/Navigation';
17+
import Performance from '@libs/Performance';
1718
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
1819
import * as SessionUtils from '@libs/SessionUtils';
1920
import {clearSoundAssetsCache} from '@libs/Sound';
@@ -178,6 +179,7 @@ function setSidebarLoaded() {
178179
}
179180

180181
Onyx.set(ONYXKEYS.IS_SIDEBAR_LOADED, true);
182+
Performance.markEnd(CONST.TIMING.SIDEBAR_LOADED);
181183
}
182184

183185
let appState: AppStateStatus;

0 commit comments

Comments
 (0)