更新记录

3.0.0(2026-08-17)

第一版更新 显示cpu、内存、温度使用情况可以更方便的监控软件性能


平台兼容性

uni-app(4.71)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
× × ×
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
× × × × × × × × × × × ×

其他

多语言 暗黑模式 宽屏模式
×

asrmall-monitor

Android、iOS 应用内性能调试悬浮层。插件只在调用后采样,不申请系统悬浮窗权限,不显示到其他应用上。

使用

// #ifdef APP
import {
  showPerformanceMonitor,
  updatePerformanceMonitor,
  hidePerformanceMonitor,
  getPerformanceSnapshotSync
} from '@/uni_modules/asrmall-monitor'

showPerformanceMonitor({
  top: 52,
  left: 8,
  updateInterval: 1000,
  opacity: 0.65,
  textSize: 12
})

// 切换到右上角。尺寸和偏移单位为 px。
updatePerformanceMonitor({ top: 52, right: 8 })

console.log(getPerformanceSnapshotSync())

// 停止采样并移除悬浮层。
hidePerformanceMonitor()
// #endif

可传配置:toprightbottomleftupdateIntervalopacitytextSize。不同次更新时新传入的一侧覆盖旧侧;同一次同时传两侧时,rightbottom 优先。

指标说明

  • CPU:当前应用进程 CPU 使用率,按设备逻辑处理器数量归一化为 0-100%
  • 内存:Android 为当前进程 PSS,iOS 为当前进程 phys_footprint,单位 MB。
  • FPS:主线程显示回调在采样窗口内的实际触发频率,主线程卡顿时会下降。
  • 温度:Android 显示系统提供的电池温度;iOS 无公开数值温度 API,显示 0
  • GPU:Android、iOS 均无稳定公开的单应用 GPU 占用率 API,显示 0

getPerformanceSnapshotSync() 额外返回 gpuSupportedtemperatureSupportedthermalState,用于区分“不支持”和真实零值。thermalState 两端统一为 0 正常、1 轻度、2 严重、3 危急。

注意

该插件用于开发调试。发布前应移除 showPerformanceMonitor 调用,避免采样本身带来少量 CPU 和内存开销。

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件只在本机读取当前应用进程性能数据,不采集、不保存、不上传数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。