resourceUsage

Bun

Symbol

Subprocess.resourceUsage

Get the resource usage information of the process (max RSS, CPU time, etc)

Only available after the process has exited

If the process hasn't exited yet, this will return undefined

Referenced types

interface ResourceUsage

  • contextSwitches: { involuntary: number; voluntary: number }

    The number of voluntary and involuntary context switches that the process made.

  • cpuTime: { system: number; total: number; user: number }

    The amount of CPU time used by the process, in microseconds.

  • maxRSS: number

    The maximum amount of resident set size (in bytes) used by the process during its lifetime.

  • messages: { received: number; sent: number }

    IPC messages sent and received by the process.

  • ops: { in: number; out: number }

    The number of IO operations done by the process.

  • shmSize: number

    The amount of shared memory that the process used.

  • signalCount: number

    The number of signals delivered to the process.

  • swapCount: number

    The number of times the process was swapped out of main memory.