Skip to content

引入

ts
import { getRUMPerformance } from 't-comm';

// 不支持 tree-shaking 的项目
import { getRUMPerformance} from 't-comm/lib/tencent-cloud/rum/index';

// 只支持 ESM 的项目
import { getRUMPerformance} from 't-comm/es/tencent-cloud/rum/index';

getRUMPerformance(secretId, secretKey, id, startTime, endTime, type)

描述:获取腾讯云 RUM(Real User Monitoring)性能数据 用于查询前端性能监控数据,支持按时间范围和类型筛选

参数

参数名描述
secretId腾讯云 SecretId
secretKey腾讯云 SecretKey
idRUM 项目 ID
startTime开始时间(时间戳或字符串)
endTime结束时间(时间戳或字符串)
type性能数据类型

返回: Promise.<{data: Array<unknown>}>

  • 返回性能数据数组

示例

ts
getRUMPerformance({
  secretId: 'your-secret-id',
  secretKey: 'your-secret-key',
  id: '123456',
  startTime: 1640000000,
  endTime: 1640086400,
  type: 'page'
}).then(result => {
  console.log('性能数据:', result.data);
});