procfs-stats
Advanced tools
Comparing version 0.0.6 to 1.0.0
22
index.js
var fs = require('fs'); | ||
var hexip = require('hexip'); | ||
var parseaddr = require('./lib/parse-addr') | ||
var nettable = require('./lib/nettable') | ||
@@ -186,7 +188,7 @@ // read the procfs stat file for a pid | ||
fs.readFile(procPath+"net/tcp",function(err,buf){ | ||
fs.readFile(__dirname+'/test/tcp-example'||procPath+"net/tcp",function(err,buf){ | ||
var t = nettable(buf); | ||
t.forEach(function(con){ | ||
con.rem_address = fixaddr(con.rem_address); | ||
con.local_address = fixaddr(con.local_address); | ||
con.rem_address = parseaddr(con.rem_address); | ||
con.local_address = parseaddr(con.local_address); | ||
}); | ||
@@ -207,4 +209,4 @@ cb(err,t,buf); | ||
t.forEach(function(con){ | ||
con.rem_address = fixaddr(con.rem_address); | ||
con.local_address = fixaddr(con.local_address); | ||
con.rem_address = parseaddr(con.rem_address); | ||
con.local_address = parseaddr(con.local_address); | ||
}); | ||
@@ -348,3 +350,6 @@ cb(err,t,buf); | ||
function nettable(data){ | ||
module.exports._nettable = _nettable | ||
function _nettable(data){ | ||
if(!data) return false; | ||
@@ -422,7 +427,2 @@ var lines = data.toString().trim().split("\n"); | ||
function fixaddr(addr){ | ||
addr = addr.split(':'); | ||
return hexip(addr[0])+':'+hexip.port(addr[1]); | ||
} | ||
function nulldelim(buf){ | ||
@@ -429,0 +429,0 @@ if(!buf) return false; |
{ | ||
"name": "procfs-stats", | ||
"version": "0.0.6", | ||
"version": "1.0.0", | ||
"description": "get detailed information (more than ps, top etc) about running process on linux machines from node.", | ||
@@ -15,3 +15,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"hexip": "~1.0.1" | ||
"hexip": "~1.0.1", | ||
"lru-cache": "^4.0.0" | ||
}, | ||
@@ -18,0 +19,0 @@ "repository": { |
@@ -13,1 +13,3 @@ | ||
}); | ||
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
126689
29
661
1
2
+ Addedlru-cache@^4.0.0
+ Addedlru-cache@4.1.5(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedyallist@2.1.2(transitive)