Skip to content

Commit

Permalink
check for nan
Browse files Browse the repository at this point in the history
  • Loading branch information
pdiemert committed Nov 13, 2013
1 parent 47f0dcb commit 590e1b4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

var _conf = require('param.json');
var _os = require('os');
var _tools = require('graphdat-plugin-tools');

var _source = _os.hostname();
var _interval = parseInt(process.argv[1]) || 1000;
var _interval = _conf.pollInterval || 1000;

var _last;

Expand All @@ -26,8 +28,8 @@ function poll()
var user = (e.times.user - l.times.user) /
(e.total - l.total);

console.log('CPU_CORE %d %s-C%d',
user, _source, idx + 1);
if (!isNaN(user))
console.log('CPU_CORE %d %s-C%d', user, _source, idx + 1);
}
}

Expand Down
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "plugin-cpu_core",
"version": "0.0.1",
"description": "CPU core plugin for Graphdat",
"main": "index.js",
"dependencies": {
"graphdat-plugin-tools" : "0.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/graphdat/plugin-cpu_core"
},
"keywords": [
"graphdat",
"plugin",
"cpu",
"core"
],
"author": "Graphdat <support@graphdat.com>",
"license": "Apache v2",
"bugs": {
"url": "https://github.com/graphdat/plugin-cpu_core/issues"
},
"engine": "node >= 0.8.1"
}

0 comments on commit 590e1b4

Please sign in to comment.