datadog-ux-utils Documentation - v1.0.0
    Preparing search index...

    Function startMemoryTracking

    • Starts polling for memory usage and optionally reports metrics to Datadog.

      Parameters

      Returns () => void

      Function to stop tracking.

      import { startMemoryTracking } from "datadog-ux-utils/memory";

      const stop = startMemoryTracking({
      intervalMs: 5000,
      onChange: (metrics) => {
      console.log("Heap usage (MB):", metrics.usedJSHeapSize / 1024 / 1024);
      }
      });

      // Stop tracking later:
      stop();