:

HardwareInfo

Method Summary

Private Methods
private
isUsingBattery(platform): Null | Boolean

Indicates whether the host is running on battery power. This can cause performance degredation.

private
memorySwapUsed(platform): Null | Number

Determines the amount of swap/virtual memory currently in use.

private

Determines the total amount of memory available to the host, as from os.totalmem.

private

Determines the amount of memory currently being used by the current Node process, as from process.memoryUsage.

private

Determines the number of logical processors available to the host, as from os.cpus.

private
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.

private

Gets the speed of the host's processors.

private

Determines the time since the host was started, as from os.uptime.

Private Methods

lib/models/hardware-info.js:232

private isUsingBattery(platform): Null | Boolean

Indicates 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:

Null | Boolean

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:266

private 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:

Null | Number

The amount of used swap space, in bytes. null if the used swap space cannot be determined.

lib/models/hardware-info.js:297

private memoryTotal( ): Number

Determines the total amount of memory available to the host, as from os.totalmem.

Return:

Number

The total memory in bytes.

lib/models/hardware-info.js:309

private memoryUsed( ): Object

Determines the amount of memory currently being used by the current Node process, as from process.memoryUsage.

Return:

Object

The Resident Set Size, as reported by process.memoryUsage.

lib/models/hardware-info.js:322

private processorCount( ): Number

Determines the number of logical processors available to the host, as from os.cpus.

Return:

Number

The number of logical processors.

lib/models/hardware-info.js:334

private 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:

Array

The one-, five-, and fifteen-minute processor load averages.

lib/models/hardware-info.js:358

private 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:

Number

The average processor speed in MHz.

Determines the time since the host was started, as from os.uptime.

Return:

Number

The number of seconds since the host was started.