Performance
webDeveloper
The ScaleBun.performance namespace — 5 members.
TypeScript
import ScaleBun from '@scalebun/web';
ScaleBun.performance.<method>(…);Members#
| Member | Signature |
|---|---|
startTransaction | startTransaction(name: string): TransactionHandle |
startTrace | startTrace(name: string): void |
stopTrace | stopTrace(name: string): void |
markScreenLoadStart | markScreenLoadStart(_screen: string): void |
sendMetric | sendMetric(metric: string, value: number): void |
Reference#
startTransaction#
TypeScript
ScaleBun.performance.startTransaction(name: string): TransactionHandleOpen a RUM transaction (a timed root with a bounded span tree). Returns a handle: const t = ScaleBun.performance.startTransaction('checkout'); const s = t.startSpan('validate'); s.finish(); t.finish();. Safe before the engine loads (no-op handle).
startTrace#
TypeScript
ScaleBun.performance.startTrace(name: string): voidBegin a custom trace span — routed through PerformanceFeature (F-PERF).
stopTrace#
TypeScript
ScaleBun.performance.stopTrace(name: string): voidEnd a custom trace span → emits a performance item with the elapsed time.
markScreenLoadStart#
TypeScript
ScaleBun.performance.markScreenLoadStart(_screen: string): voidsendMetric#
TypeScript
ScaleBun.performance.sendMetric(metric: string, value: number): void