Datalayer VS Code Extension - v0.0.4
    Preparing search index...

    Performance monitoring utilities for tracking operation timing and memory usage.

    Index

    Constructors

    Accessors

    Methods

    • Create a performance timer that can be manually controlled. Useful for tracking operations that span multiple function calls.

      Parameters

      • operationName: string

        Human-readable name for the operation

      • Optionalcontext: Record<string, unknown>

        Additional context information

      Returns PerformanceTimer

      PerformanceTimer instance

      const timer = PerformanceLogger.createTimer("multi_step_operation", { userId: "123" });
      timer.start();
      // ... do some work
      timer.checkpoint("step_1_complete");
      // ... do more work
      timer.end("success");
    • Track operation performance with automatic logging and memory monitoring. Logs start, completion, and failure with detailed performance metrics.

      Type Parameters

      • T

      Parameters

      • operationName: string

        Human-readable name for the operation

      • operation: () => Promise<T>

        Async function to execute and monitor

      • Optionalcontext: Record<string, unknown>

        Additional context information

      Returns Promise<T>

      Promise that resolves with the operation result

      const result = await PerformanceLogger.trackOperation(
      "notebook_save",
      () => saveNotebook(notebook),
      { notebookId: notebook.id, cellCount: notebook.cells.length }
      );
    • Track synchronous operation performance. For operations that don't return promises but still need timing.

      Type Parameters

      • T

      Parameters

      • operationName: string

        Human-readable name for the operation

      • operation: () => T

        Synchronous function to execute and monitor

      • Optionalcontext: Record<string, unknown>

        Additional context information

      Returns T

      The operation result