-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: move DTRACE_* probes out of global scope
The DTRACE_* probes have been global for no really good reason. Move those into an internalBinding. PR-URL: #26541 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
- Loading branch information
Showing
14 changed files
with
92 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const config = internalBinding('config'); | ||
|
||
const { | ||
DTRACE_HTTP_CLIENT_REQUEST = () => {}, | ||
DTRACE_HTTP_CLIENT_RESPONSE = () => {}, | ||
DTRACE_HTTP_SERVER_REQUEST = () => {}, | ||
DTRACE_HTTP_SERVER_RESPONSE = () => {}, | ||
DTRACE_NET_SERVER_CONNECTION = () => {}, | ||
DTRACE_NET_STREAM_END = () => {} | ||
} = (config.hasDtrace ? internalBinding('dtrace') : {}); | ||
|
||
module.exports = { | ||
DTRACE_HTTP_CLIENT_REQUEST, | ||
DTRACE_HTTP_CLIENT_RESPONSE, | ||
DTRACE_HTTP_SERVER_REQUEST, | ||
DTRACE_HTTP_SERVER_RESPONSE, | ||
DTRACE_NET_SERVER_CONNECTION, | ||
DTRACE_NET_STREAM_END | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Flags: --expose-internals | ||
'use strict'; | ||
|
||
require('../common'); | ||
const assert = require('assert'); | ||
|
||
const { | ||
DTRACE_HTTP_CLIENT_REQUEST, | ||
DTRACE_HTTP_CLIENT_RESPONSE, | ||
DTRACE_HTTP_SERVER_REQUEST, | ||
DTRACE_HTTP_SERVER_RESPONSE, | ||
DTRACE_NET_SERVER_CONNECTION, | ||
DTRACE_NET_STREAM_END | ||
} = require('internal/dtrace'); | ||
|
||
// We're just testing to make sure these are always defined and | ||
// callable. We don't actually test their function here. | ||
|
||
assert.strictEqual(typeof DTRACE_HTTP_CLIENT_REQUEST, 'function'); | ||
assert.strictEqual(typeof DTRACE_HTTP_CLIENT_RESPONSE, 'function'); | ||
assert.strictEqual(typeof DTRACE_HTTP_SERVER_REQUEST, 'function'); | ||
assert.strictEqual(typeof DTRACE_HTTP_SERVER_RESPONSE, 'function'); | ||
assert.strictEqual(typeof DTRACE_NET_SERVER_CONNECTION, 'function'); | ||
assert.strictEqual(typeof DTRACE_NET_STREAM_END, 'function'); |