- Responsiveness measures how quickly your app reacts when users interact with it. Users expect no noticeable delay between pressing a button and seeing the UI update.
- Fluidity (also called “smoothness”) measures how smoothly animations, scrolling, and video playback render, free from stutters, jank, or dropped frames.
- Use the KPI Visualizer
- Measure and understand your app’s key performance metrics
- Set up measurements
- Interpret results
Prerequisites
Before you use the Vega App KPI Visualizer:-
Install the Vega Performance API module:
-
Read the following sections:
- What each KPI measures and its target guidelines. See App KPI metrics and guidelines.
- How apps launch in different scenarios. See Launch scenarios.
- When to set performance markers. See Fully drawn marker.
- To measure foreground memory, video fluidity, or UI fluidity, follow the instructions in Measure Fluidity and Foreground Memory.
- Choose your measurement method:
App KPI metrics and guidelines
The following table presents both main KPIs and their associated Micro KPIs. Main KPIs measure overall performance metrics, while Micro KPIs represent specific measurable components that contribute to a main KPI. For example,Application JavaScript bundle load time is a Micro KPI that contributes to the overall time-to-fully-drawn (TTFD) KPI. Empty Micro KPI cells indicate that no specific sub-components contribute to that main KPI.
Launch scenarios
The KPI Visualizer measures two types of app launch scenarios to evaluate performance for TTFF and TTFD:- Cool start - When a user launches an app for the first time, and the system loads all resources and dependencies into memory.
- Warm start - When a user moves an app from background (an inactive state) to foreground (an active state) with some resources and dependencies already in memory.
Fully drawn marker
A fully drawn marker signals when your app becomes interactive for users. The marker:- Indicates when your app completes loading its essential components.
- Marks when users can start interacting with your app.
- Helps measure TTFD performance.
- Add the
useReportFullyDrawnhook to your app. - Place markers at these key points:
- Cool start - After loading initial data and rendering the main screen.
- Warm start - When your app becomes responsive after foregrounding.
Measure KPIs in VS Code
Step 1: Open the command palette in VS Code
- For Mac: Shift+Command ⌘+P
- For Linux: Ctrl+Shift+P
Step 2: Enter Vega: Launch App KPI Visualizer
Step 3: Press Enter
You can also choose the App KPI Visualizer from the Vega Studio panel.
Step 4: Choose a use case
To measure foreground memory and video streaming fluidity, create a custom test scenario that matches how your users interact with your app.
For example:
- For memory testing - Include video playback or image loading.
- For streaming - Include typical video watching patterns.
Cool start KPIs
- Launch the test app on the device.
- Wait 10 seconds for the test app to load.
- Close the test app.
- Process the KPIs.
Warm start KPIs
- Launch the test app on the device.
- Launch another app on the device, moving the test app to the background.
- Launch the test app, moving it to foreground.
- Wait 15 seconds for the test app to load.
- Close the test app.
- Process the KPIs.
Foreground memory KPIs
- Launch the test app on the device.
- Perform the specified steps in the test scenario.
- Capture the KPIs for analysis and reporting.
- Close the test app.
- Process the KPIs.
Background memory KPIs
- Launch the test app on the device.
- Launch another app on the device, moving the test app to the background.
- Wait 15 seconds to collect the test app’s KPIs.
- Close the test app.
- Process the KPIs.
UI fluidity KPIs
- Launch the test app on the device.
-
Choose your test method:
- Custom test - Use your own UI interaction scenarios
- Default test - Uses standard scrolling patterns
- Two sets of horizontal scrolls (five left, five right)
- Two sets of vertical scrolls (five down, five up)
- 900 ms between actions
-
Choose Cancel or press Esc to end the test.
- Capture the KPIs for analysis and reporting.
- Close the test app.
- Process the KPIs.
Video playback fluidity KPIs
- Launch the test app on the device.
- Perform the steps in the video playback test scenario.
- Capture the KPIs for analysis and reporting.
- Close the test app.
- Process the KPIs.
Step 5: Choose whether to ignore trace loss during the test
When your app has performance issues, significant trace loss can occur. The Vega App KPI Visualizer doesn’t load traces and shows KPIs as N/A in the report.
You can choose to ignore trace losses when generating KPI reports to view the metrics. However, ignoring trace losses produces KPI values that appear better than actual performance.
Step 6: View KPI scores in the visualizer window
The window shows the P90 (90th percentile) value calculated from three test iterations.Step 7: Assess results
To assess the results, see Understand the performance report.Measure KPIs with CLI commands
Step 1: Check device readiness
At the command prompt, run thevega exec perf doctor command to check if your host and target devices are ready.
--app-name with the package ID from the manifest.toml file. When multiple devices are running, specify the device serial number. Use the --device-serial-number parameter in the perf commands.
Example if only a single device is connected:
Step 2: Start the Vega App KPI Visualizer
app-name is the only required parameter. Replace [app-name] with the ID of the default interactive component from the manifest.toml file.
Step 3: (Optional) Specify the number of iterations
Default iterations: three, or 30 if--certification is used.
Step 4: (Optional) Specify which KPI to measure
Step 5: View all available options
stdout.
Example report:
Understand the performance report
The Vega App KPI Visualizer shows a performance report, which includes:-
Test information
- Date - The date when the system captures the KPI data.
- Device Serial ID - The unique identifier of the device running the app.
- App - The name of the app for which the KPI data appears.
- Number of iterations - The number of times the KPI measurement process runs.
- KPI Name - The name of the KPI with its unit.
- Test Name - The name of the test or the completed use case.
-
KPI Health - A color-coded system representing the health of each KPI:
- 🟢 (Green) - Meets the recommended guideline.
- 🟡 (Yellow) - Within 10% of the guideline.
- 🔴 (Red) - Exceeds the guideline by more than 10%.
- KPI Score - The numeric value of the KPI, which appears in the same unit as specified in the KPI name. If the visualizer can’t calculate the KPIs, it displays “N/A” for the KPI score and lists the KPI Health as “Unknown.”
- Guideline - The recommended value or range for the KPI score based on industry standards or performance targets.
Example results
The following images show sample results for each use case. Pay attention to the KPI Health indicators and scores relative to guidelines.Use case: cool start TTFF and TTFD
The following results show launch performance metrics. Red indicators show the app exceeds the launch time guidelines.
Use case: warm start TTFF and TTFD
The following results show how your app resumes from background state. Compare TTFF and TTFD times to evaluate optimization needs.
Use case: foreground memory
The following results show your app’s memory usage during active use. Monitor this metric to prevent performance issues from excessive memory consumption.
Use case: background memory
The following results show your app’s memory footprint while in background state. Understanding your app’s impact on system resources when inactive helps optimize background behavior.
Use case: UI fluidity
The following results show how smoothly your app handles user interactions. The percentage indicates frames successfully rendered during scrolling and navigation.
Use case: video playback fluidity
The following results show how smoothly your app plays video content. The percentage represents successful frame delivery at the intended playback rate. This scenario also includes media player and input event micro KPIs.
Open a KPI report
After the Vega App KPI Visualizer completes the test scenarios, it generates the following report files:- aggregated-kpi-report-[timestamp].json - Consolidates KPI data from all test scenarios.
- [test-name]-kpi-report-[timestamp].json - Creates one file for each individual test scenario. The [test-name] identifies the specific scenario.
Option 1 (Preferred): Use Quick Open
This method provides access to your recordings through VS Code’s interface or CLI.From VS Code
- Find the KPI report file (example:
app-launch-kpi-report-[timestamp].json) using VS Code Quick Open or in the project’sgenerateddirectory. - Choose the file once to preview or twice to open in active mode.
From the CLI
-
Open a terminal window and enter:
If your terminal doesn’t recognize the
codecommand, open the VS Code command palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Linux). - Select Shell Command: Install code command in PATH.
- Retry the command.
Option 2: Use the VS Code Command Palette
This method provides access to your recording using VS Code’s built-in command interface or if Quick Open isn’t available.- Open VS Code.
- Open the command palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Linux).
- Enter Vega: Open Recording View.
-
Choose the file you want to open, such as
app-launch-kpi-report-[timestamp].json.
Related topics
- Improve App Performance on Vega
- Measure Fluidity and Foreground Memory
- Inspect Traces
- Set Up Amazon Devices Builder Tools for AI-Powered Development

