Understand performance during a session

Compare Cordova/Capacitor session activity with native performance samples and app-defined metrics to investigate resource use.

Telemetry helps you examine how memory, frame rate, and app-specific measurements change while a session runs. The bridge uses native iOS and Android telemetry channels, and custom metrics can add context such as queue depth.

Register app metrics from JavaScript:

await Ansight.registerMetricChannel({
  id: 42,
  name: "Queue depth",
  unit: "items",
});
await Ansight.metric(7, 42);

Use enableFramesPerSecond(), disableFramesPerSecond(), isFramesPerSecondEnabled(), and captureBuiltInTelemetrySample() to control native sampling.

Open-file-handle and Android JNI-reference tracking are off by default:

const options = Ansight.createOptionsBuilder()
  .withOpenFileHandleTracking()
  .withJniReferenceCountTracking()
  .build();

Open file handles use reserved channel 7 on supported native targets. JNI references use reserved channel 6 on Android only. Do not use ids 0-7 or 255 for custom channels.

The current adapter does not add a JavaScript-heap profiler. Use app-defined channels for framework-specific metrics that are not available from the native runtime.