@dnlup/doc
Advanced tools
Comparing version 4.0.0-1 to 4.0.0-2
@@ -5,2 +5,9 @@ # Changelog | ||
## [4.0.0-2](https://github.com/dnlup/doc/compare/v4.0.0-1...v4.0.0-2) (2021-03-14) | ||
### Bug Fixes | ||
* **gc:** add start and stop ([300737d](https://github.com/dnlup/doc/commit/300737deca0036de6b4d566767241bae8c49e202)) | ||
## [4.0.0-1](https://github.com/dnlup/doc/compare/v4.0.0-0...v4.0.0-1) (2021-03-13) | ||
@@ -7,0 +14,0 @@ |
@@ -21,3 +21,5 @@ 'use strict' | ||
kReset, | ||
kObserverCallback | ||
kObserverCallback, | ||
kStart, | ||
kStop | ||
} = require('./symbols') | ||
@@ -160,2 +162,4 @@ | ||
const Entry = flags ? GCAggregatedEntry : GCEntry | ||
// TODO: this can be converted to a simple object, maybe? | ||
// I'll have to run deoptigate. | ||
this[kGCEntries] = new Map([ | ||
@@ -172,3 +176,2 @@ [NODE_PERFORMANCE_GC_MAJOR, new Entry(flags)], | ||
this[kObserver] = new PerformanceObserver(this[kObserverCallback].bind(this)) | ||
this[kObserver].observe({ entryTypes: ['gc'], buffered: true }) | ||
} | ||
@@ -182,2 +185,10 @@ | ||
[kStart] () { | ||
this[kObserver].observe({ entryTypes: ['gc'], buffered: true }) | ||
} | ||
[kStop] () { | ||
this[kObserver].disconnect() | ||
} | ||
[kReset] () { | ||
@@ -184,0 +195,0 @@ this[kPause][kReset]() |
@@ -25,3 +25,5 @@ 'use strict' | ||
kSample, | ||
kReset | ||
kReset, | ||
kStart, | ||
kStop | ||
} = require('./symbols') | ||
@@ -63,2 +65,5 @@ | ||
if (this[kStarted]) return | ||
if (this[kOptions].collect.gc) { | ||
this[kGC][kStart]() | ||
} | ||
this[kTimer] = setInterval(this[kEmitSample].bind(this), this[kOptions].sampleInterval) | ||
@@ -74,2 +79,6 @@ if (this[kOptions].unref) { | ||
this[kStarted] = false | ||
this[kReset]() | ||
if (this[kOptions].collect.gc) { | ||
this[kGC][kStop]() | ||
} | ||
} | ||
@@ -76,0 +85,0 @@ |
@@ -17,2 +17,3 @@ 'use strict' | ||
kStart: Symbol('kStart'), | ||
kStop: Symbol('kStop'), | ||
kSample: Symbol('kSample'), | ||
@@ -19,0 +20,0 @@ kReset: Symbol('kReset'), |
{ | ||
"name": "@dnlup/doc", | ||
"version": "4.0.0-1", | ||
"version": "4.0.0-2", | ||
"description": "Get usage and health data about your Node.js process", | ||
@@ -27,6 +27,6 @@ "main": "index.js", | ||
"prerelease": "npm cit", | ||
"release": "HUSKY_SKIP_HOOKS=1 standard-version --sign", | ||
"release": "HUSKY=0 standard-version --sign", | ||
"postrelease": "npm run push && npm publish", | ||
"prenext": "npm cit", | ||
"next": "HUSKY_SKIP_HOOKS=1 standard-version --sign --prerelease", | ||
"next": "HUSKY=0 standard-version --sign --prerelease", | ||
"postnext": "npm run push && npm publish --tag next", | ||
@@ -33,0 +33,0 @@ "push": "git push origin --follow-tags `git rev-parse --abbrev-ref HEAD`" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57083
913