MachineService

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

ShotInstanceservicenot creatablecomingPrograms

Up and coming

See how busy the computer is, overall and per program, so heavy work can wait its turn.

use MachineService gives it. GetLoadAsync gives processor and memory use for the whole computer, and GetProcessStatsAsync for one program with everything it started. LoadChanged samples every SampleInterval seconds, only while something is connected.

A service: write use MachineService.

Properties

NameTypeDefaultDescription
SampleIntervalnumberSeconds between samples, 2 by default.

Methods

NameArgumentsReturnsDescription
GetLoadAsync
yields
()(Load?, string?)The computer's processor use in percent and its used and total memory in bytes.
GetProcessStatsAsync
yields
(pid: number)(ProcessStats?, string?)Processor and memory use of the program with that pid, counting everything it started.

Events

NamePassesDescription
LoadChanged(Load)Fires with the computer's processor and memory load; it is sampled only while something is connected.
From ShotInstance 33