DevTools
Renderer counters you can show on screen, and named traces for Lynx's performance timeline. import { LynxDevTools, LynxPerformance, type DevToolsStats, type LynxTraceOptions } 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.
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, so you can trace the build you ship. Every method does nothing when Lynx's tracing API isn't available.
In the web preview, the traces go to the browser's performance timeline instead. Each trace becomes a User Timing measure, and each mark a User Timing mark, with the options in its detail. Chrome DevTools shows them in the Performance panel's Timings track.
LynxPerformance.isRecording()
Returns true while a recording is running. In the web preview, it always returns true, since the browser's performance timeline is always on.
LynxPerformance.profileStart()
Starts a named trace. Pair each call with profileEnd(). Traces nest. See LynxTraceOptions for the options.
LynxPerformance.profileEnd()
Ends the most recently started trace.
LynxPerformance.profileMark()
Records a single point in time. It takes the same options as profileStart(), so a flowId links a mark to traces too.
LynxPerformance.profileFlowId()
Returns a new ID for linking traces, for example across threads. Returns 0 when tracing isn't available.
Types
DevToolsStats
LynxTraceOptions
The options of profileStart() and profileMark(), the same as Lynx's own TraceOption.
