Cpu
Handle operation on cpu sensor.
Usage
cpu
keyword is needed to instanciate this sting.
var cpu = require('cpu');
Data accessors
- cpuArchitecture
- cpuCores
- cpuImplementer
- cpuPart
- cpuRevision
- cpuVariant
- hardware
- idleTime
- loadAverage15Min
- loadAverage1Min
- loadAverage5Min
- loadAverageActiveTasks
- loadAverageTotalTasks
- processor
- revision
- serial
- timestamp
- uptime
Methods
Full Example
var cpu = require('cpu');
var recorder = require('recorder');
var dataResult = cpu.data();
recorder.save({
'cpuArchitecture' : cpu.cpuArchitecture(),
'cpuCores' : cpu.cpuCores(),
'cpuImplementer' : cpu.cpuImplementer(),
'cpuPart' : cpu.cpuPart(),
'cpuRevision' : cpu.cpuRevision(),
'cpuVariant' : cpu.cpuVariant(),
'hardware' : cpu.hardware(),
'idleTime' : cpu.idleTime(),
'loadAverage15Min' : cpu.loadAverage15Min(),
'loadAverage1Min' : cpu.loadAverage1Min(),
'loadAverage5Min' : cpu.loadAverage5Min(),
'loadAverageActiveTasks' : cpu.loadAverageActiveTasks(),
'loadAverageTotalTasks' : cpu.loadAverageTotalTasks(),
'processor' : cpu.processor(),
'revision' : cpu.revision(),
'serial' : cpu.serial(),
'timestamp' : cpu.timestamp(),
'uptime' : cpu.uptime(),
'json' : cpu.data()
});
cpuArchitecture
Retrieve the Value of the architecture.
cpuArchitecture();
Parameters
- None.
Return
- cpuArchitecture : Integer, Value of the architecture
cpuCores
Retrieve the Number of CPU cores.
cpuCores();
Parameters
- None.
Return
- cpuCores : Integer, Number of CPU cores
cpuImplementer
Retrieve the Value of the CPU implementer.
cpuImplementer();
Parameters
- None.
Return
- cpuImplementer : String, Value of the CPU implementer
cpuPart
Retrieve the Value of the part.
cpuPart();
Parameters
- None.
Return
- cpuPart : String, Value of the part
cpuRevision
Retrieve the Value of the revision.
cpuRevision();
Parameters
- None.
Return
- cpuRevision : Integer, Value of the revision
cpuVariant
Retrieve the Value of the variant.
cpuVariant();
Parameters
- None.
Return
- cpuVariant : String, Value of the variant
hardware
Retrieve the Value of the hardware.
hardware();
Parameters
- None.
Return
- hardware : String, Value of the hardware
idleTime
Retrieve the CPU idle time.
idleTime();
Parameters
- None.
Return
- idleTime : Float, CPU idle time
loadAverage15Min
Retrieve the Load average of the past 15 minutes.
loadAverage15Min();
Parameters
- None.
Return
- loadAverage15Min : Float, Load average of the past 15 minutes
loadAverage1Min
Retrieve the Load average of the past minute.
loadAverage1Min();
Parameters
- None.
Return
- loadAverage1Min : Float, Load average of the past minute
loadAverage5Min
Retrieve the Load average of the past 5 minutes.
loadAverage5Min();
Parameters
- None.
Return
- loadAverage5Min : Float, Load average of the past 5 minutes
loadAverageActiveTasks
Retrieve the Load average of the active tasks.
loadAverageActiveTasks();
Parameters
- None.
Return
- loadAverageActiveTasks : Integer, Load average of the active tasks
loadAverageTotalTasks
Retrieve the Load average of the total tasks.
loadAverageTotalTasks();
Parameters
- None.
Return
- loadAverageTotalTasks : Integer, Load average of the total tasks
processor
Retrieve the Name of the processor.
processor();
Parameters
- None.
Return
- processor : String, Name of the processor
revision
Retrieve the Value of the revision.
revision();
Parameters
- None.
Return
- revision : String, Value of the revision
serial
Retrieve the Value of the serial.
serial();
Parameters
- None.
Return
- serial : String, Value of the serial
timestamp
Retrieve the represents the time of the operation..
timestamp();
Parameters
- None.
Return
- timestamp : Long, represents the time of the operation.
uptime
Retrieve the CPU uptime.
uptime();
Parameters
- None.
Return
- uptime : Float, CPU uptime
data
Returns every available seed.
data();
Parameters
- None.