/*** Queries the real-time performance snapshot of a running mini game. Supported only for the mini game engine.** @param appid Mini program appid* @param callback Performance snapshot callback*/public static void queryPerformance(String appId, MiniCallback<PerformanceSnapshot> callback)
Field | Description |
appId | Mini game appid. |
pid | PID of the process where the mini game resides. |
pkgVersion | Mini game version. |
sdkVersion | SDK version. |
baseLibVersion | Base library version. |
Field | Description |
requesttimeMs | Network time spent fetching mini game configuration information. |
loadtimeMs | Time from tapping to logic layer readiness (including base library loading and code injection). |
readytimeMs | Time from tapping to first screen rendering readiness (appearance of the first frame). |
Field | Description |
memoryCurrentKb | Current memory (KB). |
memoryAvgKb | Average memory (KB). |
memoryPeakKb | Peak memory (KB). |
memoryGrowthKb | Memory increment (KB). |
Field | Description |
cpuAvg | Average CPU usage (%). |
cpuPeak | Peak CPU usage (%). |
cpuCurrent | Current CPU usage (%). |
Field | Description |
fpsAvg | Average frame rate. The current frame rate is sampled once per second, and the arithmetic mean of all samples within the session is calculated. |
fpsVariance | Frame rate variance. This is the population variance ( Σ(fps - mean)² / n, not standard deviation, in fps²) calculated from up to the last 200 per-second FPS samples. A larger variance indicates more severe frame rate jitter and a less stable image; the value itself does not equal frame rate loss. |
jankCount | Stuttering count. A jank is recorded when a frame's rendering time is both greater than twice the average of the previous 3 frames and greater than 83.3 ms. |
bigJankCount | Severe stuttering count. A bigJank is recorded when a frame's rendering time is both greater than twice the average of the previous 3 frames and greater than 125 ms. |
Field | Description |
downloadRecords | All download records during the current runtime, deduplicated by module (keeping the last one). Defaults to an empty list. module: Subpackage name. flowBytes: Download traffic. costMs: Download time. |
runningDurationMs | Foreground running duration (ms). |
TmfMiniSDK.queryPerformance(appId, (code, msg, snapshot) -> {if (code == MiniCode.CODE_OK && snapshot != null) {Log.i(TAG, "fpsAvg=" + snapshot.fpsAvg+ ", memoryCurrentKb=" + snapshot.memoryCurrentKb+ ", cpuAvg=" + snapshot.cpuAvg);} else {Log.w(TAG, "queryPerformance failed, code=" + code + ", msg=" + msg);}});
C_CLIENT_MINI_APP_NOT_SUPPORT.FPS/jank are sampled every second. When the mini game has just started or has been running in the foreground for only a few seconds, metrics like fpsVariance, peaks, and variances may be 0 or lack reference value.fpsVariance is variance, not standard deviation: The unit is fps², which has a different dimension than the frame rate. It cannot be directly added to or subtracted from fpsAvg ; it is only used for horizontal comparison of frame rate stability. The window limit is 200 samples (about 200 seconds), and older samples are overwritten.jankCount / bigJankCount are cumulative values: They accumulate over the lifecycle of the current process and are not reset when switching between the foreground and background. To observe the stuttering increment during a specific period, you must calculate the difference between two query results yourself. The thresholds for jank (frame time > 83.3 ms and a sudden increase relative to the previous 3 frames) and bigJank (> 125 ms) are implemented by the MagicBrush engine and may be adjusted with engine versions. We recommend focusing on trend comparisons rather than hardcoding dependencies on the thresholds themselves.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan