Skip to content

@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 ​

ParameterType
options?PerformancePluginOptions

Returns ​

PerformancePlugin

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"performance"'performance'插件唯一名,重复注册报错src/plugins/performance/index.ts:53
requiredConsentreadonly"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 ​

ParameterType
ctxPluginContext

Returns ​

void

Implementation of ​

TracePlugin.setup


teardown() ​

ts
teardown(): void;

Defined in: src/plugins/performance/index.ts:154

注销清理:destroy 时调用

Returns ​

void

Implementation of ​

TracePlugin.teardown


startTransaction() ​

ts
startTransaction(opts): Transaction;

Defined in: src/plugins/performance/index.ts:165

L1 手动事务;未装配(_manual 为 null)时返回 no-op 事务避免抛错

Parameters ​

ParameterType
opts{ name: string; op?: string; }
opts.namestring
opts.op?string

Returns ​

Transaction


markHydration() ​

ts
markHydration(): void;

Defined in: src/plugins/performance/index.ts:171

L1 水合标记;未 setup no-op

Returns ​

void

基于 MIT 协议发布(内部使用)