AvaCapoSDK~ PerformanceMonitor

Lightweight plugin for SceneManager that overlays the classic FPS panel (Stats.js) from Three.js examples. It is loaded lazily only when enabled, so it adds no bundle cost unless explicitly used. Works only in browser environments with DOM.

Typical usage:

const manager = new SceneManager(container, {
  devtools: {
    stats: {
      enabled: true,
      style: 'position:absolute;top:0;right:0;'
    }
  }
});

Integration is automatic when SceneManager is constructed with devtools.stats.enabled=true. Can also be attached/detached manually:

const monitor = new PerformanceMonitor();
await monitor.attach(manager);
// later:
monitor.detach();

Hooks:

  • Calls stats.begin() on onBeforeTick
  • Calls stats.end() on onAfterRender

Methods:

  • attach(manager) - installs the overlay, registers loop observers
  • detach() - removes overlay and unsubscribes
  • enable() - show overlay
  • disable() - hide overlay
  • toggle() - toggle overlay visibility

Constructor

new PerformanceMonitor(optionsopt)

Parameters:
NameTypeAttributesDefaultDescription
optionsAvaCapoSDK.PerformanceMonitorOptions<optional>
{}

Optional configuration for the stats overlay.