New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

oppsy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oppsy - npm Package Compare versions

Comparing version

to
1.0.2

76

lib/index.js

@@ -15,49 +15,49 @@ 'use strict';

class Oppsy extends Events.EventEmitter {
constructor(server, config) {
constructor(server, config) {
super();
config = config || {};
this._networkMonitor = new NetworkMonitor(server, config.httpAgents, config.httpsAgents);
this._tasks = {
osload: OsMonitor.loadavg,
osmem: OsMonitor.mem,
osup: OsMonitor.uptime,
psup: ProcessMonitor.uptime,
psmem: ProcessMonitor.memoryUsage,
psdelay: ProcessMonitor.delay,
requests: this._networkMonitor.requests,
concurrents: this._networkMonitor.concurrents,
responseTimes: this._networkMonitor.responseTimes,
sockets: this._networkMonitor.sockets
};
}
super();
config = config || {};
this._networkMonitor = new NetworkMonitor(server, config.httpAgents, config.httpsAgents);
this._tasks = {
osload: OsMonitor.loadavg,
osmem: OsMonitor.mem,
osup: OsMonitor.uptime,
psup: ProcessMonitor.uptime,
psmem: ProcessMonitor.memoryUsage,
psdelay: ProcessMonitor.delay,
requests: this._networkMonitor.requests,
concurrents: this._networkMonitor.concurrents,
responseTimes: this._networkMonitor.responseTimes,
sockets: this._networkMonitor.sockets
};
}
start(interval) {
start(interval) {
Hoek.assert(interval <= 2147483647, 'interval must be less than 2147483648');
const host = Os.hostname();
this._interval = setInterval(() => {
Hoek.assert(interval <= 2147483647, 'interval must be less than 2147483648');
const host = Os.hostname();
this._interval = setInterval(() => {
Items.parallel.execute(this._tasks, (error, results) => {
Items.parallel.execute(this._tasks, (error, results) => {
if (error) {
this.emit('error', error);
}
else {
results.host = host;
this.emit('ops', results);
}
this._networkMonitor.reset();
});
}, interval);
}
if (error) {
this.emit('error', error);
}
else {
results.host = host;
this.emit('ops', results);
}
this._networkMonitor.reset();
});
}, interval);
}
stop() {
stop() {
clearInterval(this._interval);
this._networkMonitor.reset();
this.emit('stop');
}
clearInterval(this._interval);
this._networkMonitor.reset();
this.emit('stop');
}
}
module.exports = Oppsy;
{
"name": "oppsy",
"version": "1.0.1",
"version": "1.0.2",
"repository": "git://github.com/hapijs/oppsy",

@@ -21,9 +21,9 @@ "description": "An EventEmitter useful for collecting hapi server ops information",

"code": "2.x.x",
"hapi": "11.x.x",
"lab": "7.x.x"
"hapi": "13.x.x",
"lab": "10.x.x"
},
"dependencies": {
"hoek": "3.x.x",
"hoek": "4.x.x",
"items": "2.x.x"
}
}

Sorry, the diff of this file is not supported yet