node-oom-heapdump 3.0.0-beta → 3.0.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/index.js +0 -20
- package/package.json +1 -1
package/README.md
CHANGED
@@ -52,10 +52,11 @@ These might impact performance though.
|
|
52
52
|
On Node.js 12.x the latter two flags seem to cause some stability issues (see https://github.com/nodejs/node/issues/27552#issuecomment-542695931). So, if you encounter issues on Node.js 12.x in combination with those flags, please refrain from using these.
|
53
53
|
|
54
54
|
# Options
|
55
|
+
* addTimestamp - add a timestamp to the heapdump filename, to make it unique. Default is false.
|
55
56
|
* port - optionally, the alternative DevTools protocol port. Defaults to 9229. Should map on the port given to the --inspect arg.
|
56
57
|
|
57
58
|
# API
|
58
|
-
The
|
59
|
+
The API for creating heapdumps and CPU profiles on request. See below for the currently available API.
|
59
60
|
|
60
61
|
Notice that you cannot create a heapdump while a CPU profile is being generated and vice versa; an Error will be thrown if this is the case.
|
61
62
|
|
package/index.js
CHANGED
@@ -81,31 +81,11 @@ class NodeOomHeapdumpAPI {
|
|
81
81
|
|
82
82
|
// utility functions
|
83
83
|
function parseOptions(options) {
|
84
|
-
if (options.heapdumpOnOOM === undefined) {
|
85
|
-
options.heapdumpOnOOM = true;
|
86
|
-
}
|
87
|
-
if (options.OOMImplementation === undefined){
|
88
|
-
// default is the implementation, the old one was discarded because it wasn't used
|
89
|
-
options.OOMImplementation = "NATIVE_HOOK";
|
90
|
-
}
|
91
84
|
if (options.port === undefined) {
|
92
85
|
options.port = 9229;
|
93
86
|
} else {
|
94
87
|
options.port = parseInt(options.port);
|
95
88
|
}
|
96
|
-
if (options.path === undefined) {
|
97
|
-
options.path = "OoM-pid-" + process.pid;
|
98
|
-
}
|
99
|
-
if (options.limit === undefined) {
|
100
|
-
options.limit = 3;
|
101
|
-
} else {
|
102
|
-
options.limit = parseInt(options.limit);
|
103
|
-
}
|
104
|
-
if (options.threshold === undefined) {
|
105
|
-
options.threshold = 70;
|
106
|
-
} else {
|
107
|
-
options.threshold = parseInt(options.threshold);
|
108
|
-
}
|
109
89
|
if (options.addTimestamp === undefined) {
|
110
90
|
options.addTimestamp = false;
|
111
91
|
} else {
|