Skip to content
Kunkun

System Info

Docs: https://docs.api.kunkun.sh/interfaces/ui.ISystemInfo

This API provides information about the system, such as CPU, memory, and disk usage.

Sample Code

import { sysInfo } from "@kksh/api/ui/worker"
// or
import { sysInfo } from "@kksh/api/ui/iframe"
await sysInfo.refreshCpu()
const cpuInfo = await sysInfo.cpuInfo()
cpuInfo.cpus.forEach((cpu) => {
console.log("name: ", cpu.name)
console.log("frequency: ", cpu.frequency)
console.log("cpu_usage: ", cpu.cpu_usage)
console.log("vendor_id: ", cpu.vendor_id)
console.log("brand: ", cpu.brand)
})

API and Permissions

  • allSysInfo: [ system-info:all ]
  • totalMemory: [ system-info:all,system-info:memory ]
  • usedMemory: [ system-info:all,system-info:memory ]
  • totalSwap: [ system-info:all,system-info:memory ]
  • usedSwap: [ system-info:all,system-info:memory ]
  • memoryInfo: [ system-info:all,system-info:memory ]
  • hostname: [ system-info:all,system-info:network ]
  • name: [ system-info:all,system-info:os ]
  • kernelVersion: [ system-info:all,system-info:os ]
  • osVersion: [ system-info:all,system-info:os ]
  • staticInfo: [ system-info:all,system-info:os ]
  • components: [ system-info:all,system-info:components ]
  • cpus: [ system-info:all,system-info:cpu ]
  • cpuCount: [ system-info:all,system-info:cpu ]
  • cpuInfo: [ system-info:all,system-info:cpu ]
  • disks: [ system-info:all,system-info:disk ]
  • networks: [ system-info:all,system-info:network ]
  • processes: [ system-info:all,system-info:process ]
  • refreshAll: [ system-info:all ]
  • refreshMemory: [ system-info:all,system-info:memory ]
  • refreshCpu: [ system-info:all,system-info:cpu ]
  • refreshProcesses: [ system-info:all,system-info:process ]
  • batteries: [ system-info:all,system-info:battery ]