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:allsystem-info:memory ]
  • usedMemory: [ system-info:allsystem-info:memory ]
  • totalSwap: [ system-info:allsystem-info:memory ]
  • usedSwap: [ system-info:allsystem-info:memory ]
  • memoryInfo: [ system-info:allsystem-info:memory ]
  • hostname: [ system-info:allsystem-info:network ]
  • name: [ system-info:allsystem-info:os ]
  • kernelVersion: [ system-info:allsystem-info:os ]
  • osVersion: [ system-info:allsystem-info:os ]
  • staticInfo: [ system-info:allsystem-info:os ]
  • components: [ system-info:allsystem-info:components ]
  • cpus: [ system-info:allsystem-info:cpu ]
  • cpuCount: [ system-info:allsystem-info:cpu ]
  • cpuInfo: [ system-info:allsystem-info:cpu ]
  • disks: [ system-info:allsystem-info:disk ]
  • networks: [ system-info:allsystem-info:network ]
  • processes: [ system-info:allsystem-info:process ]
  • refreshAll: [ system-info:all ]
  • refreshMemory: [ system-info:allsystem-info:memory ]
  • refreshCpu: [ system-info:allsystem-info:cpu ]
  • refreshProcesses: [ system-info:allsystem-info:process ]
  • batteries: [ system-info:allsystem-info:battery ]