smr-performance-monitor-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.0 • Public • Published

smr-performance-monitor-sdk

上报

import { webPerformance } from 'smr-performance-monitor-sdk';
const wbePerf = new webPerformance();
// 配置参数 
wbePerf.setReportApi({
            accountId:"XXX",
            uin: 'XXX',
            serviceType: "XXX",
            token: "XXX",
            // 可选
            env: 'XXX',
          });


// 开始点标记
wbePerf.start('标记名称');
// 计算点的标记  返回前后标记的持续时间
const duration=wbePerf.start('end');

// 自定义埋点上报
wbePerf.trackReport({
              moduleName: 'XXX',
              eventName: 'XXX',
              eventType: 'XXX',
              exts:{
                ...
              },
              performance:{
                ...
              }
})


// 配置 请求中网络对象   key 保证唯一性
wbePerf.setNetworkInfo(key,value)
// 删除 请求中网络对象 
wbePerf.deleteNetworkInfo(key)

// 监听dom第一次变化  和 网络请求完成时回调cb dom和回调函数
wbePerf.listenDomChange(target,cb)

Readme

Keywords

none

Package Sidebar

Install

npm i smr-performance-monitor-sdk

Weekly Downloads

1

Version

1.0.0-beta.0

License

ISC

Unpacked Size

46.6 kB

Total Files

4

Last publish

Collaborators

  • yma1998