From 7c2513747343d7811da10c4403081e921cf3f8b7 Mon Sep 17 00:00:00 2001 From: mistryswapnil-dream11 Date: Wed, 13 Mar 2024 11:49:11 +0530 Subject: [PATCH] chore: update ReadMe.md --- .../scripts/node/getFlashlightScore.ts | 7 ++++-- README.md | 25 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Benchamrking/scripts/node/getFlashlightScore.ts b/Benchamrking/scripts/node/getFlashlightScore.ts index 1221efe..33e3697 100644 --- a/Benchamrking/scripts/node/getFlashlightScore.ts +++ b/Benchamrking/scripts/node/getFlashlightScore.ts @@ -1,9 +1,11 @@ +const packageJson = require("../../package.json") const { execSync } = require("child_process") globalThis.process.env.MAESTRO_RENDER_ANIMATION_BUTTON='render_animations' globalThis.process.env.MAESTRO_ANIMATION_CONTAINER='animation_continer' const appId = globalThis.process.argv[2] +const iterationCount = globalThis.process.argv[3] || 1 const stdio = { @@ -11,6 +13,7 @@ const stdio = { } const rootDirectoryPath = '../../../Reports' +const reportsDirectoryPath = `${rootDirectoryPath}/${packageJson.dependencies["react-native"]}/android` if (!appId) { console.log("App id must be specified to run automation script.") @@ -20,5 +23,5 @@ if (!appId) { execSync(`flashlight test --bundleId ${appId} \ --testCommand "maestro test -e APP_ID=${appId} ../automation/flashlightflow.yaml" \ --duration 10000 \ ---resultsFilePath ${rootDirectoryPath}/flashlightscore.json \ ---iterationCount 1`, stdio) \ No newline at end of file +--resultsFilePath ${reportsDirectoryPath}/flashlightscore.json \ +--iterationCount ${iterationCount}`, stdio) \ No newline at end of file diff --git a/README.md b/README.md index 9704f54..6ad6a8c 100644 --- a/README.md +++ b/README.md @@ -83,14 +83,25 @@ yarn install 3. This scripts will help getting numbers for time taken to render N views, texts, images component and flashlight score for spin animations of N views. 5. Run the following to get rendering time of N views, texts, images (tested on Android emulator & iOS Simulator): ``` - yarn get:numbers:android - // Example: yarn get:numbers:android 10 - yarn get:numbers:ios - // Example: yarn get:numbers:ios 10 + yarn get:numbers:android + /* Example: yarn get:numbers:android 10 */ + yarn get:numbers:ios + /* Example: yarn get:numbers:ios 10 */ ``` 6. Run the following command to get flashlight score (supported only on Android): ``` - yarn get:flashlight:score + yarn get:flashlight:score + /* Example: yarn get:flashlight:score 10 + Defaults to 1 iteration + */ ``` - -> NOTE: 1. Benchmarking numbers can be found at same locations for respective platform's as specfied above. 2. Flashlight report can be found under **Reports** directory with name **flashlightscore.json**. + 7. Check flashlight score by running: + ``` + flashlight report + /* Example: flashlight report ../Reports/0.73.5/android/flashlightscore.json (assuming you are inside Benchamrking/ directory) */ +``` +NOTE: +1. After running automation scripts the benchmarking numbers can be found under Reports/ +2. So, if we are benchmarking for react-native version 0.73.5 the rendering benchmarking numbers will be found under Reports/0.73.5/android for android & Reports/0.73.5/ios for iOS for both architecture +3. Since flashlight is only supported on android the flashlight score can be found under Reports//android +``` \ No newline at end of file