This utility is a simple charting utility that allows you to export logs from Flipper and view them in a timeline chart. It was created using create-react-app.
- Flipper (https://fbflipper.com/)
- Inkitt Flash App (https://github.com/inkitt/flash)
- Startup Flipper and select the 'React Native Logs' tab
- Use console.log in the inkitt/flash app formatted like this
const startTime = launchAppTimeStore.currentTimeFromAppStart
methodToProfileHere()
const logTitle = "withBootstrapper-init"
const endTime = launchAppTimeStore.currentTimeFromAppStart
console.log(
`PERF-MONITOR-LOG|${logTitle}|${startTime}|${endTime}`,
);
Note:
( TODO: Provide utility method in inkitt/flash to wrap this logic )
- Each element in this console must be
|
deliniated and follow the format below. PERF-MONITOR-LOG
is a hardcoded string that you should not change.logTitle
often the name of the method to be profiledstartTime
the best way to get this is to use the launchAppTimeStore as demonstrated aboveendTime
the best way to get this is to use the launchAppTimeStore as demonstrated above
- Run the inkitt/flash app
- Enter
PERF-MONITOR-LOG
in the "Search" bar in flipper to filter the logs to only perf monitoring logs - Highlight all rows and select
Copy Row(s) -> Copy Row(s) JSON
- Add a new file to
src/data/logs/<FILE_NAME_HERE>.json
. File name can be anything you want it to be but should be unique across all files in this directory. - Run
npm run start
to start the app. - Select the
View Logs
button. - All files that exist in the
logs
directory will be available in the dropdown above the chart.
- Startup Flipper and select the 'Network' tab (it may be disabled)
- Run the inkitt/flash app
- Highlight desired rows in Flipper network logs and select
Copy Row(s) -> Copy Row(s) JSON
- Add a new file to
src/data/network/<FILE_NAME_HERE>.json
. File name can be anything you want it to be but should be unique across all files in this directory. - Run
npm run start
to start the app. - Select the
View Network Performance
button. - All files that exist in the
network
directory will be available in the dropdown above the chart.