Skip to content

system

luau
local system = require("@lute/system")

WARNING

These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.

Summary

EntryDescription
CpuInfoCPU information for a single logical processor, including model, speed, and time-usage breakdown.
archThe CPU architecture of the current machine, e.g. "x64", "arm64".
cpusReturns CPU information for each logical processor on the current machine.
freeMemoryReturns the amount of free (available) system memory in bytes.
hostNameReturns the hostname of the current machine.
osThe current operating system, e.g. "linux", "macos", "windows".
threadCountReturns the number of logical CPU threads available on the current machine.
tmpdirReturns the path to the system's temporary directory.
totalMemoryReturns the total amount of system memory in bytes.
uptimeReturns the system uptime in seconds.

Types

CpuInfo

CPU information for a single logical processor, including model, speed, and time-usage breakdown.

luau
type CpuInfo = {
	model: string,
	speed: number,

	times: {
		sys: number,
		idle: number,
		irq: number,
		nice: number,
		user: number,
	},
}

Functions and Properties

system.arch

The CPU architecture of the current machine, e.g. "x64", "arm64".

luau
string

system.cpus

Returns CPU information for each logical processor on the current machine.

luau
() -> { CpuInfo }

system.freeMemory

Returns the amount of free (available) system memory in bytes.

luau
() -> number

system.hostName

Returns the hostname of the current machine.

luau
() -> string

system.os

The current operating system, e.g. "linux", "macos", "windows".

luau
string

system.threadCount

Returns the number of logical CPU threads available on the current machine.

luau
() -> number

system.tmpdir

Returns the path to the system's temporary directory.

luau
() -> string

system.totalMemory

Returns the total amount of system memory in bytes.

luau
() -> number

system.uptime

Returns the system uptime in seconds.

luau
() -> number