Skip to content

Commit

Permalink
Merge pull request #60 from soyuka/rever-59
Browse files Browse the repository at this point in the history
Don't use cpus count to compute pcpu revert #59
  • Loading branch information
soyuka authored Jun 11, 2018
2 parents ed9f81d + e00f66e commit e3f0c05
Show file tree
Hide file tree
Showing 3 changed files with 1,234 additions and 352 deletions.
3 changes: 1 addition & 2 deletions lib/ps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var os = require('os')
var bin = require('./bin')

var PLATFORM = os.platform()
var cpus = os.cpus().length

function parseTime (timestr, fraction) {
var time = 0
Expand Down Expand Up @@ -95,7 +94,7 @@ function ps (pids, options, done) {

var pid = parseInt(line[1], 10)
var ppid = parseInt(line[2], 10)
var cpu = parseFloat(line[3].replace(',', '.'), 10) / cpus
var cpu = parseFloat(line[3].replace(',', '.'), 10)
var memory = parseInt(line[4], 10) * 1024
var etime = parseTime(line[0])
var ctime = parseTime(line[5], true)
Expand Down
Loading

0 comments on commit e3f0c05

Please sign in to comment.