Skip to content

systemStats

Install the required plugin:

Terminal window
tynd add system-stats
import { systemStats } from "@tynd/plugin-system-stats/client";

Backed by sysinfo. The host keeps a single System instance behind a mutex so CPU usage is computed as a delta between successive cpu() calls (the very first call returns a meaningful baseline rather than a flat 0%).

  • systemStats.cpu(): Promise<CpuStats> — aggregate CPU usage + core count + brand.
  • systemStats.memory(): Promise<MemoryStats> — RAM + swap totals/usage in bytes.
  • systemStats.disks(): Promise<DiskInfo[]> — mounted disks with capacity and filesystem type.
  • systemStats.processes(limit?, offset?): Promise<ProcessInfo[]> — paginated, sorted by ascending PID. limit defaults to 50, capped at 1000.
  • systemStats.uptime(): Promise<{ seconds: number }> — host uptime in whole seconds.