DEV Community

HarmonyOS
HarmonyOS

Posted on

How to extend the recording time when Profiler monitors the performance of SDK operation?

Read the original article:How to extend the recording time when Profiler monitors the performance of SDK operation?

Context

When using DevEco Profiler to monitor SDK performance, the recording session automatically ends after about 7–8 minutes. This creates limitations during long-term performance monitoring and analysis.

Description

DevEco Profiler provides real-time monitoring capabilities across multiple system resources such as CPU, memory, GPU, frame rate, network, and power consumption.

  • It allows top-down analysis of performance bottlenecks.
  • Developers can use it to detect memory leaks, thrashing, and overflows with the Allocation tool.
  • However, by default, recording sessions are constrained to relatively short durations (7–8 minutes).

Solution / Approach

To extend the recording duration, you need to modify the Profiler configuration file:

1.Navigate to the following directory:

   C:\Users\xxxxxx\AppData\Local\Huawei\DevEcoStudioxx
Enter fullscreen mode Exit fullscreen mode

2.Inside the .insight folder, open the file config.json5.

3.Depending on the monitoring template you are using, adjust the restrainedDuration value (unit: seconds):

For Allocation template:

   "JSAllocationUsage": [
     {
       "scene": 0,
       "recommendedDuration": 300,
       "restrainedDuration": 480
     }
   ]
Enter fullscreen mode Exit fullscreen mode

For CPU template:

   "CpuPlaceholderUnitV101": [
     {
       "scene": 0,
       "recommendedDuration": 30,
       "restrainedDuration": 120
     }
   ]
Enter fullscreen mode Exit fullscreen mode

Example: To extend the Allocation recording session to 15 minutes (900 seconds), set "restrainedDuration": 900.

Key Takeaways

  • Default session duration is limited (approx. 7–8 minutes).
  • Duration limits can be increased by modifying restrainedDuration in config.json5.
  • JSAllocationUsage → used for memory allocation monitoring.
  • CpuPlaceholderUnitV101 → used for CPU performance monitoring.
  • Values are in seconds, so adjust according to your monitoring needs.

Written by Mehmet Algul

Top comments (0)