We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e44b1c8 commit f5fad20Copy full SHA for f5fad20
lib/gc.js
@@ -64,11 +64,14 @@ class GCEntry {
64
[kSample] (ns) {
65
this[kTotalDuration] += ns
66
/**
67
- * We have to truncate the value here because `record`
+ * We have to adjust the value here because `record`
68
* only accepts integer values:
69
* https://github.com/nodejs/node/blob/cdad3d8fe5f468aec6549fd59db73a3bfe063e3c/lib/internal/histogram.js#L283-L284
70
*/
71
- this[kHistogram].record(Math.trunc(ns))
+ const val = Math.floor(ns)
72
+ if (val > 0) {
73
+ this[kHistogram].record(val)
74
+ }
75
}
76
77
[kReset] () {
0 commit comments