Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
268 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
{ | ||
"name": "sigar", | ||
"description": "Sigar binding for Node.js", | ||
"keywords": ["cluster", "system", "cpu", "os", "network"], | ||
"version": "0.0.1", | ||
"description": "Sigar binding", | ||
"homepage": "http://www.adaltas.com/projects/node-mecano/", | ||
"author": "David Worms <david@adaltas.com>", | ||
"contributors": [{ | ||
"name": "David Worms", | ||
"email": "david@adaltas.com" | ||
}], | ||
"engines": { "node": ">= 0.6" }, | ||
"bugs": { | ||
"url": "https://github.com/wdavidw/node-sigar/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wdavidw/node-sigar.git" | ||
}, | ||
"homepage": "https://github.com/wdavidw/node-sigar" | ||
"bugs": { | ||
"email": "open@adaltas.com", | ||
"url": "https://github.com/wdavidw/node-sigar.git" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"mocha": "latest", | ||
"should": "latest" | ||
}, | ||
"contributors": [ | ||
{ "name": "David Worms", "email": "david@adaltas.com" } | ||
], | ||
"main": "index", | ||
"engines": { "node": ">= 0.6.0" }, | ||
"scripts": { | ||
"test": "mocha" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
|
||
assert = require 'assert' | ||
should = require 'should' | ||
sigar = require '..' | ||
|
||
module.exports = | ||
'Test cpu': (next) -> | ||
s = sigar() | ||
describe 'cpu', -> | ||
|
||
s = sigar() | ||
|
||
it 'should return overall cpu usage', -> | ||
cpu = s.cpu() | ||
# console.log 'cpu', cpu | ||
assert.eql [ | ||
Object.keys(cpu).should.eql [ | ||
'user', 'sys', 'nice', 'idle', 'wait', 'irq', 'soft_irq', 'stolen', 'total' | ||
], Object.keys(cpu) | ||
next() | ||
'Test cpuList': (next) -> | ||
s = sigar() | ||
] | ||
|
||
it 'should list cpu with current usage', -> | ||
cpuList = s.cpuList() | ||
# console.log 'cpuList', cpuList | ||
assert.ok cpuList.length > 0 | ||
assert.eql [ | ||
cpuList.length.should.be.above 0 | ||
Object.keys(cpuList[0]).should.eql [ | ||
'user', 'sys', 'nice', 'idle', 'wait', 'irq', 'soft_irq', 'stolen', 'total' | ||
], Object.keys(cpuList[0]) | ||
next() | ||
'Test cpuInfoList': (next) -> | ||
s = sigar() | ||
] | ||
|
||
it 'should list cpu with information': -> | ||
cpuInfoList = s.cpuInfoList() | ||
# console.log 'cpuInfoList', cpuInfoList | ||
assert.ok cpuInfoList.length > 0 | ||
assert.eql [ | ||
cpuList.length.should.be.above 0 | ||
Object.keys(cpuInfoList[0]).should.eql [ | ||
'vendor', 'model', 'mhz', 'mhz_max', 'mhz_min', 'cache_size', 'total_sockets', 'total_cores', 'cores_per_socket' | ||
], Object.keys(cpuInfoList[0]) | ||
next() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
assert = require 'assert' | ||
sigar = require '..' | ||
|
||
describe 'misc', -> | ||
|
||
s = sigar() | ||
|
||
it 'should output formated size', -> | ||
formatSize = s.formatSize 8492389262 | ||
# console.log 'formatSize', formatSize | ||
formatSize.should.eql '7.9G' |
Oops, something went wrong.