method

Subprocess.resourceUsage

Get the resource usage of the process, such as max RSS and CPU time

Returns undefined until the process has exited

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 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.