Install prettier and eslint

This commit is contained in:
Eric Mc Sween
2020-09-11 15:59:33 -04:00
parent c530422f1e
commit 971a768c4e
14 changed files with 1102 additions and 804 deletions
+41 -35
View File
@@ -5,44 +5,50 @@
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
let OpenSocketsMonitor;
const URL = require("url");
const seconds = 1000;
let OpenSocketsMonitor
const { URL } = require('url')
const seconds = 1000
// In Node 0.10 the default is 5, which means only 5 open connections at one.
// Node 0.12 has a default of Infinity. Make sure we have no limit set,
// regardless of Node version.
require("http").globalAgent.maxSockets = Infinity;
require("https").globalAgent.maxSockets = Infinity;
require('http').globalAgent.maxSockets = Infinity
require('https').globalAgent.maxSockets = Infinity
module.exports = (OpenSocketsMonitor = {
monitor(logger) {
const interval = setInterval(() => OpenSocketsMonitor.gaugeOpenSockets()
, 5 * seconds);
const Metrics = require("./index");
return Metrics.registerDestructor(() => clearInterval(interval));
},
module.exports = OpenSocketsMonitor = {
monitor(logger) {
const interval = setInterval(
() => OpenSocketsMonitor.gaugeOpenSockets(),
5 * seconds
)
const Metrics = require('./index')
return Metrics.registerDestructor(() => clearInterval(interval))
},
gaugeOpenSockets() {
let agents, hostname, url;
const Metrics = require("./index");
const object = require('http').globalAgent.sockets;
for (url in object) {
agents = object[url];
url = URL.parse(`http://${url}`);
hostname = url.hostname != null ? url.hostname.replace(/\./g, "_") : undefined;
Metrics.gauge(`open_connections.http.${hostname}`, agents.length);
}
return (() => {
const result = [];
const object1 = require('https').globalAgent.sockets;
for (url in object1) {
agents = object1[url];
url = URL.parse(`https://${url}`);
hostname = url.hostname != null ? url.hostname.replace(/\./g, "_") : undefined;
result.push(Metrics.gauge(`open_connections.https.${hostname}`, agents.length));
}
return result;
})();
}
});
gaugeOpenSockets() {
let agents, hostname, url
const Metrics = require('./index')
const object = require('http').globalAgent.sockets
for (url in object) {
agents = object[url]
url = new URL(`http://${url}`)
hostname =
url.hostname != null ? url.hostname.replace(/\./g, '_') : undefined
Metrics.gauge(`open_connections.http.${hostname}`, agents.length)
}
return (() => {
const result = []
const object1 = require('https').globalAgent.sockets
for (url in object1) {
agents = object1[url]
url = new URL(`https://${url}`)
hostname =
url.hostname != null ? url.hostname.replace(/\./g, '_') : undefined
result.push(
Metrics.gauge(`open_connections.https.${hostname}`, agents.length)
)
}
return result
})()
}
}