Comparing version 0.1.2 to 0.1.3
@@ -5,3 +5,3 @@ var binding = require('bindings')('node_usage'); | ||
binding.process_usage(parseInt(pid), function(err, cpu, memory) { | ||
binding.lookup(parseInt(pid), function(err, cpu, memory) { | ||
@@ -8,0 +8,0 @@ if(err) { |
{ | ||
"name": "usage", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "simple way to lookup linux process usage", | ||
@@ -18,2 +18,5 @@ "keywords": [ | ||
"main": "./lib/usage.js", | ||
"scripts": { | ||
"test": "test/index.js" | ||
}, | ||
"engines": { | ||
@@ -26,4 +29,4 @@ "node": ">= 0.8.x" | ||
"devDependencies": { | ||
"mocha": "1.8.x" | ||
} | ||
} |
@@ -1,5 +0,25 @@ | ||
var usage = require('../'); | ||
usage.lookup(22248, function() { | ||
var usage = require('../'); | ||
var assert = require('assert'); | ||
console.log(arguments); | ||
suite('Usage', function() { | ||
test('invalid pid', function(done) { | ||
usage.lookup(1232323, function(err) { | ||
assert.ok(err); | ||
done(); | ||
}); | ||
}); | ||
test('valid pid', function(done) { | ||
usage.lookup(process.pid, function(err, result) { | ||
assert.equal(err, null); | ||
assert.ok(result.cpu >= 0); | ||
assert.ok(result.memory > 0); | ||
done(); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
498235
87
37
1