:
HardwareInfo
Method Summary
Public Methods | |
---|---|
public |
isUsingBattery(platform): Null | Boolean
Inidcates whether the host is running on battery power. This can cause performance degredation. |
public |
memorySwapUsed(platform): Null | Number
Determines the amount of swap/virtual memory currently in use. |
public |
memoryTotal( ): Number
Determines the total amount of memory available to the host, as from |
public |
memoryUsed( ): Object
Determines the amount of memory currently being used by the current Node process, as from |
public |
processorCount( ): Number
Determines the number of logical processors available to the host, as from |
public |
processorLoad(platform): Array
Determines the average processor load across the system. This is expressed as a fractional number between 0 and the number of logical processors. |
public |
processorSpeed( ): Number
Gets the speed of the host's processors. |
public |
Determines the time since the host was started, as from |
Public Methods
lib/models/hardware-info.js:232
public isUsingBattery(platform): Null | Boolean
Inidcates whether the host is running on battery power. This can cause performance degredation.
Parameters:
Name | Type | Attribute | Description |
---|---|---|---|
platform | String=process.platform |
|
The current hardware platform. USED FOR TESTING ONLY. |
Return:
true
iff the host is running on battery power or
false
if not. null
if the battery status
cannot be determined.
lib/models/hardware-info.js:265
public memorySwapUsed(platform): Null | Number
Determines the amount of swap/virtual memory currently in use.
Parameters:
Name | Type | Attribute | Description |
---|---|---|---|
platform | String=process.platform |
|
The current hardware platform. USED FOR TESTING ONLY. |
Return:
The amount of used swap space, in bytes. null
if
the used swap space cannot be determined.
lib/models/hardware-info.js:295
public memoryTotal( ): Number
Determines the total amount of memory available to the host, as from
os.totalmem
.
Return:
The total memory in bytes.
lib/models/hardware-info.js:306
public memoryUsed( ): Object
Determines the amount of memory currently being used by the current Node
process, as from process.memoryUsage
.
Return:
The Resident Set Size, as reported by
process.memoryUsage
.
lib/models/hardware-info.js:318
public processorCount( ): Number
Determines the number of logical processors available to the host, as from
os.cpus
.
Return:
The number of logical processors.
lib/models/hardware-info.js:329
public
processorLoad(platform): Array
Determines the average processor load across the system. This is expressed as a fractional number between 0 and the number of logical processors.
Parameters:
Name | Type | Attribute | Description |
---|---|---|---|
platform | String=process.platform |
|
The current hardware platform. USED FOR TESTING ONLY. |
Return:
The one-, five-, and fifteen-minute processor load averages.
lib/models/hardware-info.js:352
public processorSpeed( ): Number
Gets the speed of the host's processors.
If more than one processor is found, the average of their speeds is taken.
Return:
The average processor speed in MHz.
lib/models/hardware-info.js:366
public uptime( ): Number
Determines the time since the host was started, as from os.uptime
.
Return:
The number of seconds since the host was started.