- 文档首页
应用性能监控全链路版
用户指南
客户端监控
WebPro 端监控
SDK 接入
生命周期
生命周期
通过on挂载监听,通过off卸载监听。
监听实例被初始化。
client('on', 'init', () => {
监听实例开启上报。
client('on', 'start', () => {
监听实例配置变更之前,可拿到新的配置。
client('on', 'beforeConfig', (config: Partial<Config>) => {
监听实例配置变更后的瞬间。
client('on', 'config', () => {
监听实例被挂载属性的瞬间,可拿到属性名。
client('on', 'provide', (name: string) => {
监听事件被监控插件发送的瞬间, 可用于为事件补充上下文, 返回Falsy类型则不上报。
client('on', 'report', (ev: ReportEvent): ReportEvent | Falsy => {
export type Falsy = false | null | undefined
监听事件被包装上下文之前的瞬间, 能够拿到即将被包装的数据, 返回Falsy类型则不上报。
client('on', 'beforeBuild', (ev: ReportEvent): ReportEvent | Falsy => {
export type Falsy = false | null | undefined
监听事件被包装上下文之后的瞬间,能够拿到即将上报的数据, 返回Falsy类型则不上报。
client('on', 'build', (ev: SendEvent): SendEvent | Falsy => {
export type Falsy = false | null | undefined
监听事件被发送之前的瞬间, 返回Falsy类型则不上报。
client('on', 'beforeSend', (ev: SendEvent): SendEvent | Falsy => {
export type Falsy = false | null | undefined
注册事件发送之后的回调。
client('on', 'send', (e: Callback<SendEvent>) => {
注册实例销毁之前的回调。
client('on', 'beforeDestroy', () => {
SendEvent && ReportEvent 类型声明
| PerformanceLongTaskReport
| PerformanceTimingReport
export type WebReport = Omit<SendEvent,'common'>
export type ReportEvent<T extends WebReport> = T & {
overrides?: Partial<Common>
最近更新时间:2025.03.07 15:01:59