DevTools
Renderer counters you can show on screen, and named traces for Lynx's performance timeline. import { LynxDevTools, LynxPerformance, type DevToolsStats } from '@blotch/angular-lynx';
Usage
API
LynxDevTools
Reads the counters that AngularLynx's renderer keeps. They count only in development builds. In a production build, they stay at 0.
- Per thread. Each thread keeps its own counters. The main thread's counters describe what you see on screen.
LynxDevTools.stats
The counters as a signal. It doesn't update by itself: call refresh() to read new values.
LynxDevTools.refresh()
Updates stats with the current counter values.
LynxDevTools.snapshot()
Returns the current counter values once, without a signal.
LynxDevTools.reset()
Sets every counter to 0 and updates stats.
LynxPerformance
Adds your own named traces and marks to the performance recording that Lynx DevTool (the desktop debugger app) captures. Unlike the counters, it works in every build, not only development builds. Every method does nothing when Lynx's tracing API isn't available.
LynxPerformance.isRecording()
Returns true while a recording is running.
LynxPerformance.profileStart()
Starts a named trace. Pair each call with profileEnd(). Traces nest.
LynxPerformance.profileEnd()
Ends the most recently started trace.
LynxPerformance.profileMark()
Records a single point in time, with optional args.
LynxPerformance.profileFlowId()
Returns a new ID for linking traces, for example across threads. Returns 0 when tracing isn't available.
