@tripo3d/lens / index / PerformancePlugin
Class: PerformancePlugin
Defined in: src/plugins/performance/index.ts:52
性能监控插件(L3,opt-in 显式装配):串接六类采集器(Navigation/LongTask/SlowResource + Web Vitals + Manual/Hydration) → 统一产出 type:'performance' 的 RawEvent(op 区分子类、event_format <app>.Perf)→ ctx.emit。 只 emit span(不发请求、不采样——采样归 L4);不 import 其它插件;经 PerformanceAdapter 访问 performance 全局;受 Consent performance 管控。
Implements
Constructors
Constructor
ts
new PerformancePlugin(options?): PerformancePlugin;Defined in: src/plugins/performance/index.ts:71
Parameters
| Parameter | Type |
|---|---|
options? | PerformancePluginOptions |
Returns
PerformancePlugin
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "performance" | 'performance' | 插件唯一名,重复注册报错 | src/plugins/performance/index.ts:53 |
requiredConsent | readonly | "performance" | undefined | 所需授权维度(FR-6.4):声明后受 Consent 启停管控;缺省则不受控(如 IdentityPlugin) | src/plugins/performance/index.ts:54 |
Methods
setup()
ts
setup(ctx): void;Defined in: src/plugins/performance/index.ts:75
注册激活:Core 在 init 时调用
Parameters
| Parameter | Type |
|---|---|
ctx | PluginContext |
Returns
void
Implementation of
teardown()
ts
teardown(): void;Defined in: src/plugins/performance/index.ts:154
注销清理:destroy 时调用
Returns
void
Implementation of
startTransaction()
ts
startTransaction(opts): Transaction;Defined in: src/plugins/performance/index.ts:165
L1 手动事务;未装配(_manual 为 null)时返回 no-op 事务避免抛错
Parameters
| Parameter | Type |
|---|---|
opts | { name: string; op?: string; } |
opts.name | string |
opts.op? | string |
Returns
markHydration()
ts
markHydration(): void;Defined in: src/plugins/performance/index.ts:171
L1 水合标记;未 setup no-op
Returns
void