![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ah-collector
Advanced tools
Super light wrapper around async-hooks to collect information about resources created during async operations.
Super light wrapper around async-hooks to collect information about resources created during async operations.
const ActivityCollector = require('ah-collector')
function captureStack(hook, { uid, type, triggerId }, resource) {
// Predicate to decide if a stack should be captured or not.
// Capture only inits of the TIMERWRAP but everything of the Timeout.
return type === 'Timeout' || (type === 'TIMERWRAP' && hook === 'init')
}
const collector = new ActivityCollector({
start: process.hrtime()
, captureStack
}).enable()
setTimeout(ontimeout, 100)
function ontimeout() {
collector
.processStacks()
.dump()
}
Needs async hooks feature, therefore build from this PR for now.
npm install ah-collector
Creates an instance of an ActivityCollector
Parameters
$0
Object
$0.start
Array<Number> start time obtained via process.hrtime()
$0.stackCapturer
StackCapturer? which is used to decide if a stack
should be captured as well as to capture and process it @see
thlorenz/ah-stack-capturer
The default capturer used doesn't ever capture a stack so this feature is
turned off by default. (optional, default defaultStackCapturer
)$0.requireInit
boolean? when true
any activities whose init
hook we missed
are ignored even if we see before
, after
and/or destroy
hooks. (optional, default false
)Returns ActivityCollector instance of ActivityCollector
Enables the collection of async hooks. Needs to be called as otherwise nothing will be collected.
Returns ActivityCollector activityCollector
Disables the collection of async hooks.
Nothing will be collected until activityCollector.enable()
is called.
Returns ActivityCollector activityCollector
Clears all currently collected activity.
Returns ActivityCollector activityCollector
Returns an Array of all activities collected so far that are of the specified type(s).
Parameters
Returns Array activities matching the specified type(s)
A getter
that returns a map of all activities collected so far.
Returns Map activities
A getter
that returns an Array of all activities collected so far.
Returns Array activities
Processes all stacks that were captured for specific activities This is done in line, i.e. the actual stacks of the activity objects are modified.
Returns ActivityCollector activityCollector
Dumps all so far collected activities to the console. This is useful for diagnostic purposes.
If no arguments are provided, all activities are dumped.
Parameters
opts
Object allow tweaking which activities are dumped and how
Returns ActivityCollector activityCollector
Dumps all types in the order they were collected including id and trigger id.
Example: FSREQWRAP:id:triggerId
Static getter that denotes the type given to activities whose type is unkown since
we missed their init
event.
MIT
FAQs
Super light wrapper around async-hooks to collect information about resources created during async operations.
The npm package ah-collector receives a total of 3 weekly downloads. As such, ah-collector popularity was classified as not popular.
We found that ah-collector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.