From 2bf423218ce4d66021db0c1ca9c4f4b8882b377f Mon Sep 17 00:00:00 2001 From: JeeveshJ7 Date: Mon, 11 Nov 2024 20:30:13 +0530 Subject: [PATCH 1/2] parallel execution of static URLs --- docs/smartui-cli.md | 34 ++++++++++++++++++++++++++++--- docs/smartui-sdk-fetch-results.md | 2 +- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/docs/smartui-cli.md b/docs/smartui-cli.md index 0e3ab118..0ffa20c4 100644 --- a/docs/smartui-cli.md +++ b/docs/smartui-cli.md @@ -252,9 +252,6 @@ steps: smartui capture urls.json --config smartui-web.json ``` - - - ### SmartUI CLI Options and Keys The following are supported `CLI (Command Line Interface)` options for Visual Regression Testing with SmartUI: @@ -270,6 +267,37 @@ You can see the Smart UI dashboard to view the results. This will help you ident cmd +### Parallely running static URLs + +You can reduce the build time by executing parallel URLs in the following way. + +```bash +npx smartui capture urls.json --config .smartui.json --parallel --fetch-results +``` + +- The `--parallel` flag determines how many URLs will be processed simultaneously +- Each thread captures screenshots independently, maximizing throughput + +>**Example:** +>```bash +>npx smartui capture urls.json --config .smartui.json --parallel 3 --fetch-results +>``` + +#### Determining Optimal Thread Count +The maximum number of parallel threads is calculated using the formula: log2(N) where N is the total number of URLs. + +>**For example:** +>- For 100 URLs: Maximum parallel threads = log2(100) = 6 threads +>- For 50 URLs: Maximum parallel threads = log2(50) = 5 threads +>- For 25 URLs: Maximum parallel threads = log2(25) = 4 threads + +#### Best Practices for parallel execution + +- Start with a lower thread count and gradually increase based on your system's performance +- Monitor system resources during execution +- Ensure stable internet connection for reliable parallel processing + + For additional information about SmartUI APIs please explore the documentation [here](https://www.lambdatest.com/support/api-doc/) diff --git a/docs/smartui-sdk-fetch-results.md b/docs/smartui-sdk-fetch-results.md index 8a360b46..21af2b32 100644 --- a/docs/smartui-sdk-fetch-results.md +++ b/docs/smartui-sdk-fetch-results.md @@ -61,7 +61,7 @@ SmartUI CLI allows you to fetch detailed build results after executing your visu ## Steps to Use -### *Step 1:* Install SmartUI CLI +### **Step 1:** Install SmartUI CLI If you haven't already installed SmartUI CLI, install it using npm: From ac3618345ff1f3e7c71509594d58433bd0638bf5 Mon Sep 17 00:00:00 2001 From: JeeveshJ7 Date: Mon, 11 Nov 2024 21:00:04 +0530 Subject: [PATCH 2/2] parallel execution of static URLs --- docs/smartui-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/smartui-cli.md b/docs/smartui-cli.md index 0ffa20c4..ebc0879b 100644 --- a/docs/smartui-cli.md +++ b/docs/smartui-cli.md @@ -267,7 +267,7 @@ You can see the Smart UI dashboard to view the results. This will help you ident cmd -### Parallely running static URLs +### Parallel execution of static URLs You can reduce the build time by executing parallel URLs in the following way.