0.0.2 • Published 12 years ago

Probes.js v0.0.2

Weekly downloads
12
License
-
Repository
github
Last release
12 years ago

https://www.codeship.io/projects/28901820-b33f-0131-c8ce-0aac319845e5/status

Probes.js

  • A Node.js module to get server load statistics

Probes.js provides a simple toolkit to measure the load of a server and to get basic information for a running process. It has been tested to work on Mac Os X and Linux.

Basic Example

Installation npm install Probes.js

How to Use

var probes = require('Probes.js');

//Print the number of hard drives connected to the server
probes.hardDriveProbe(function(err,results){
    if(!err)console.log(results.length);
});

Function Documentation

hardDriveProbe

probes.hardDriveProbe(function(err,results){});

results = [{fileSystem      : name,
            totalSpace      : Ko,
            usedSpace       : Ko,
            availableSpace  : Ko,
            percentUsed     : percent,
            mountPoint      : path}];

folderProbe

probes.folderProbe(path,function(err,results){});

results = folderSizeKo;

cpuProbe

probes.cpuProbe(function(err,results){});

results = { spot    : percentRigthNow,
            one     : averageLastMinute,
            five    : averageLastFiveMinutes,
            fifteen : averageLastFifteenMinutes};

memoryProbe

probes.memoryProbe(function(err,results){});

results = {freeMemory       : freeMemory,
            activeMemory    : usedMemory,
            totalMemory     : totalMemory};

processListProbe

probes.processListProbe(function(err,results){});

results = [{pid  : processPid,
            name : commandName,
            time : elapsedTime,
            pcpu : percentOfCpuUsed,
            pmem : percentOfMemoryUsed}];