MachineService
Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.
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
| Name | Type | Default | Description |
|---|---|---|---|
| SampleInterval | number | Seconds between samples, 2 by default. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| 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
| Name | Passes | Description |
|---|---|---|
| LoadChanged | (Load) | Fires with the computer's processor and memory load; it is sampled only while something is connected. |
From ShotInstance 33
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
