<commit_before>var assert = require('assert');
var ns = require('../src/nsutil/nsosx.js'); 

describe('[platform] osx', function() {

    it ('[method] virtualMemory', function() {
        var vMem = ns.virtualMemory();
        console.log(vMem);
    });

    it ('[method] swapMemory', function() {
        var sMem = ns.swapMemory();
        console.log(sMem);
        assert.equal(sMem.total, sMem.used + sMem.free);
    });

    it ('[method] cpuTimes & perCpuTime', function() {
        var c = ns.cpuTimes();
        console.log(c);
    })

    it ('[method] perCpuTimes', function() {
        var p = ns.perCpuTimes();
        console.log(p);
    });

    it ('[method] cpuCountLogical', function() {
        var n = ns.cpuCountLogical();
        console.log(n);
    })

    it ('[method] cpuCountPhys', function() {
        var n = ns.cpuCountPhys();
        console.log(n);
    })

    it ('[method] bootTime', function() {
        var t = ns.bootTime();
        console.log(t);
    });

    it ('[method] diskPartitions', function() {
        var d = ns.diskPartitions();
        console.log(d);
    })

    it ('[method] users', function() {
        var u = ns.users();
        console.log('[');
        u.forEach(function(v) {
            console.log(' ', JSON.stringify(v));
        });
        console.log(']');
    });

    it ('[method] pids', function() {
        var p = ns.pids();
        console.log(JSON.stringify(p));
    });

    it ('[method] netConnections', function() {
        var c = ns.netConnections();
        console.log('格式参见proc.connections');
    });

    it ('[method] netIOCounters', function() {
        var n = ns.netIOCounters();
        console.log(n);
    })

    it ('[method] diskIOCounters', function() {
        var d = ns.diskIOCounters();
        console.log(d);
    })

    describe('[Class] Process', function() {
        
        var pid = ns.pids()[0];
        var proc = ns.Process(pid);

        it ('[method] process.name', function() {
            var n = proc.name();
            console.log(n);
        })

        it ('[method] process.exe', function() {
            var e = proc.exe();
            console.log(e);
        })

        it ('[method] process.cmdline', function() {
            var c = proc.cmdline();
            console.log(c);
        })

        it ('[method] process.ppid', function() {
            var p = proc.ppid();
            console.log(p);
        })

        it ('[method] proc.cwd', function() {
            var c = proc.cwd();
            console.log(c);
        })

        it ('[method] proc.uids', function() {
            var u = proc.uids();
            console.log(u);
        })

        it ('[method] proc.gids', function() {
            var g = proc.gids();
            console.log(g);
        })

        it ('[method] proc.teminal', function() {
            var t = proc.terminal();
            console.log(t);
        })

        it ('[method] proc.memoryInfo', function() {
            var m = proc.memoryInfo();
            console.log(m);
        })

        it ('[method] proc.cpuTimes', function() {
            var c = proc.cpuTimes();
            console.log(c);
        })
        
        it ('[method] proc.createTime', function() {
            var t = proc.createTime();
            console.log(t);
        })

        it ('[method] proc.numCtxSwitches', function() {
            var c = proc.numCtxSwitches();
            console.log(c);
        })

        it ('[method] proc.numThreads', function() {
            var t = proc.numThreads();
            console.log(t);
        })
        
        it ('[method] proc.openFiles', function() {
            var f = proc.openFiles();
            console.log(f);
        })

        it ('[method] proc.connections', function() {
            var c = proc.connections();
            c = ns.Process(1421).connections('inet');
            console.log(c);
        })

        it ('[method] proc.numFds', function() {
            var n = proc.numFds();
            console.log(n);
        })
<commit_msg>update test_osx<commit_after>var assert = require('assert');
var ns = require('../src/nsutil/nsosx.js'); 

describe('[platform] osx', function() {

    it ('[method] virtualMemory', function() {
        var vMem = ns.virtualMemory();
        console.log(vMem);
    });

    it ('[method] swapMemory', function() {
        var sMem = ns.swapMemory();
        console.log(sMem);
        assert.equal(sMem.total, sMem.used + sMem.free);
    });

    it ('[method] cpuTimes & perCpuTime', function() {
        var c = ns.cpuTimes();
        console.log(c);
    })

    it ('[method] perCpuTimes', function() {
        var p = ns.perCpuTimes();
        console.log(p);
    });

    it ('[method] cpuCountLogical', function() {
        var n = ns.cpuCountLogical();
        console.log(n);
    })

    it ('[method] cpuCountPhys', function() {
        var n = ns.cpuCountPhys();
        console.log(n);
    })

    it ('[method] bootTime', function() {
        var t = ns.bootTime();
        console.log(t);
    });

    it ('[method] diskPartitions', function() {
        var d = ns.diskPartitions();
        console.log(d);
    })

    it ('[method] users', function() {
        var u = ns.users();
        console.log('[');
        u.forEach(function(v) {
            console.log(' ', JSON.stringify(v));
        });
        console.log(']');
    });

    it ('[method] pids', function() {
        var p = ns.pids();
        console.log(JSON.stringify(p));
    });

    it ('[method] netConnections', function() {
        var c = ns.netConnections();
        console.log('格式参见proc.connections');
    });

    it ('[method] netIOCounters', function() {
        var n = ns.netIOCounters();
        console.log(n);
    })

    it ('[method] diskIOCounters', function() {
        var d = ns.diskIOCounters();
        console.log(d);
    })

    describe('[Class] Process', function() {
        
        var pid = ns.pids()[0];
        var proc = ns.Process(pid);

        it ('[method] process.name', function() {
            var n = proc.name();
            console.log(n);
        })

        it ('[method] process.exe', function() {
            var e = proc.exe();
            console.log(e);
        })

        it ('[method] process.cmdline', function() {
            var c = proc.cmdline();
            console.log(c);
        })

        it ('[method] process.ppid', function() {
            var p = proc.ppid();
            console.log(p);
        })

        it ('[method] proc.cwd', function() {
            var c = proc.cwd();
            console.log(c);
        })

        it ('[method] proc.uids', function() {
            var u = proc.uids();
            console.log(u);
        })

        it ('[method] proc.gids', function() {
            var g = proc.gids();
            console.log(g);
        })

        it ('[method] proc.teminal', function() {
            var t = proc.terminal();
            console.log(t);
        })

        it ('[method] proc.memoryInfo', function() {
            var m = proc.memoryInfo();
            console.log(m);
        })

        it ('[method] proc.cpuTimes', function() {
            var c = proc.cpuTimes();
            console.log(c);
        })
        
        it ('[method] proc.createTime', function() {
            var t = proc.createTime();
            console.log(t);
        })

        it ('[method] proc.numCtxSwitches', function() {
            var c = proc.numCtxSwitches();
            console.log(c);
        })

        it ('[method] proc.numThreads', function() {
            var t = proc.numThreads();
            console.log(t);
        })
        
        it ('[method] proc.openFiles', function() {
            var f = proc.openFiles();
            console.log(f);
        })

        it ('[method] proc.connections', function() {
            var c = proc.connections();
           // c = ns.Process(1421).connections('inet');
            console.log(c);
        })

        it ('[method] proc.numFds', function() {
            var n = proc.numFds();
            console.log(n);
        })

{'fraction_non_alphanumeric': 0.17467356491746736, 'fraction_numerical': 0.001231830500123183, 'mean_word_length': 1.636038961038961, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6565222', 'n_tokens_mistral': 2518, 'n_tokens_neox': 2453, 'n_words': 521}