diff options
Diffstat (limited to 'desktop/modules/perf/Perf.js')
| -rw-r--r-- | desktop/modules/perf/Perf.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/desktop/modules/perf/Perf.js b/desktop/modules/perf/Perf.js index d067d3b..eb0dbd7 100644 --- a/desktop/modules/perf/Perf.js +++ b/desktop/modules/perf/Perf.js @@ -186,16 +186,21 @@ function procs(text) { // One {key, name, rx, tx} per TCP socket in `ss -tinpH` output: a line // naming the owner in users:((...)), then the -i line under it with the // byte counters. Sockets ss names no owner for (other users', without root) -// are skipped. The key is both endpoints and the pid, so a reused port in -// another process is a new socket. +// are skipped, except NFS: the kernel's client owns that socket, so a file +// manager copying to or from a share shows nothing of its own, and the +// traffic is listed as "NFS <server>" instead. The key is both endpoints and +// the pid, so a reused port in another process is a new socket. function sockets(text) { const out = []; let cur = null; for (const line of text.split("\n")) { - const u = /^\S+\s+\d+\s+\d+\s+(\S+)\s+(\S+)\s+users:\(\("([^"]*)",pid=(\d+)/.exec(line); + let u = /^\S+\s+\d+\s+\d+\s+(\S+)\s+(\S+)\s+users:\(\("([^"]*)",pid=(\d+)/.exec(line); if (u) { cur = { key: u[1] + " " + u[2] + " " + u[4], name: u[3], rx: 0, tx: 0 }; out.push(cur); + } else if ((u = /^\S+\s+\d+\s+\d+\s+(\S+)\s+(\S+):2049\s*$/.exec(line))) { + cur = { key: u[1] + " " + u[2] + ":2049", name: "NFS " + u[2], rx: 0, tx: 0 }; + out.push(cur); } else if (cur && /^\s/.test(line)) { cur.rx = Number((/bytes_received:(\d+)/.exec(line) || [0, 0])[1]); cur.tx = Number((/bytes_sent:(\d+)/.exec(line) || [0, 0])[1]); |
