:

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

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

public

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

public

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

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

Gets the speed of the host's processors.

public

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

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:

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

Null | Number

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:

Number

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:

Object

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:

Number

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:

Array

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:

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.