aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/_http_client.js2
-rw-r--r--lib/_http_server.js2
-rw-r--r--lib/internal/bootstrap/node.js27
-rw-r--r--lib/net.js2
4 files changed, 26 insertions, 7 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 372ac0f953..cbc7774489 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -285,7 +285,6 @@ util.inherits(ClientRequest, OutgoingMessage);
ClientRequest.prototype._finish = function _finish() {
DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
- COUNTER_HTTP_CLIENT_REQUEST();
OutgoingMessage.prototype._finish.call(this);
};
@@ -554,7 +553,6 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
}
DTRACE_HTTP_CLIENT_RESPONSE(socket, req);
- COUNTER_HTTP_CLIENT_RESPONSE();
req.res = res;
res.req = req;
diff --git a/lib/_http_server.js b/lib/_http_server.js
index 6e1b2c90e5..b216eab32a 100644
--- a/lib/_http_server.js
+++ b/lib/_http_server.js
@@ -140,7 +140,6 @@ util.inherits(ServerResponse, OutgoingMessage);
ServerResponse.prototype._finish = function _finish() {
DTRACE_HTTP_SERVER_RESPONSE(this.connection);
- COUNTER_HTTP_SERVER_RESPONSE();
OutgoingMessage.prototype._finish.call(this);
};
@@ -624,7 +623,6 @@ function parserOnIncoming(server, socket, state, req, keepAlive) {
res.shouldKeepAlive = keepAlive;
DTRACE_HTTP_SERVER_REQUEST(req, socket);
- COUNTER_HTTP_SERVER_REQUEST();
if (socket._httpMessage) {
// There are already pending outgoing res, append.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index d6ed79254d..997323d810 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -172,11 +172,11 @@
NativeModule.require('internal/process/esm_loader').setup();
}
+ const { deprecate } = NativeModule.require('internal/util');
{
// Install legacy getters on the `util` binding for typechecking.
// TODO(addaleax): Turn into a full runtime deprecation.
const { pendingDeprecation } = process.binding('config');
- const { deprecate } = NativeModule.require('internal/util');
const utilBinding = internalBinding('util');
const types = internalBinding('types');
for (const name of [
@@ -195,6 +195,31 @@
}
}
+ // TODO(jasnell): The following have been globals since around 2012.
+ // That's just silly. The underlying perfctr support has been removed
+ // so these are now deprecated non-ops that can be removed after one
+ // major release cycle.
+ if (process.platform === 'win32') {
+ function noop() {}
+ const names = [
+ 'NET_SERVER_CONNECTION',
+ 'NET_SERVER_CONNECTION_CLOSE',
+ 'HTTP_SERVER_REQUEST',
+ 'HTTP_SERVER_RESPONSE',
+ 'HTTP_CLIENT_REQUEST',
+ 'HTTP_CLIENT_RESPONSE'
+ ];
+ for (var n = 0; n < names.length; n++) {
+ Object.defineProperty(global, `COUNTER_${names[n]}`, {
+ configurable: true,
+ enumerable: false,
+ value: deprecate(noop,
+ `COUNTER_${names[n]}() is deprecated.`,
+ 'DEP00XX')
+ });
+ }
+ }
+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
setupAllowedFlags();
diff --git a/lib/net.js b/lib/net.js
index 981ee876ba..fdf7e8a1d0 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -615,7 +615,6 @@ Socket.prototype._destroy = function(exception, cb) {
cb(exception);
if (this._server) {
- COUNTER_NET_SERVER_CONNECTION_CLOSE(this);
debug('has server');
this._server._connections--;
if (this._server._emitCloseIfDrained) {
@@ -1522,7 +1521,6 @@ function onconnection(err, clientHandle) {
socket._server = self;
DTRACE_NET_SERVER_CONNECTION(socket);
- COUNTER_NET_SERVER_CONNECTION(socket);
self.emit('connection', socket);
}