Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
async-tracer
Advanced tools
Trace all async operations, output as newline delimited JSON logs, with minimal overhead.
Trace all async operations, output as newline delimited JSON logs, with minimal overhead.
Node v4 to v6
require('async-tracer')(process.stderr)
require('async-tracer')('/var/async.' + process.pid + '.log')
require('async-tracer')(1) // 1 is STDOUT, default
require('async-tracer')() //same thing
require('async-tracer') => (WritableStream, opts) => {enable, disable}
require('async-tracer') => (String: path, ops) => {enable, disable}
require('async-tracer') => (Number: handle, opts) => {enable, disable}
enable
Start tracing (will start automatically if autostart
option is true
)
disable
Stop all tracing
autostart
[default: true
] Boolean
Begin tracing immediately
append
[default: false
] Boolean
Only applies to when a path is supplied, opens file with a
flag
instead of w
flag.
prefix
[default: undefined
] Object
Additional data to attach to the beginning of each log message.
suffix
[default: undefined
] Object
Additional data to attach to the end of each log message.
stacks
[default: false
] Boolean
or Number
If true
then include an array of call sites in
each init
log, as the stack
property. The stack array takes the following form:
["functionName:fileName:lineNum:colNum"]
If set to a number, (from 1 to Infinity) stacks
will also
determine the maximum amount of frames to capture for the log
(defaults to Infinity
if true
).
contexts
[default: false
] Boolean
Supply the operations context in the pre
and post
logs as the ctx
property.
The context is an exposed C object that holds state for the async op.
Overhead of using async-tracer
is about 25%.
npm run benchmark
Running 10s test @ http://localhost:3000
10 connections with 10 pipelining factor
Stat Avg Stdev Max
Latency (ms) 0.23 0.8 54
Req/Sec 33283.64 2291.73 35135
Bytes/Sec 3.7 MB 250.51 kB 3.93 MB
Running 10s test @ http://localhost:3000
10 connections with 10 pipelining factor
Stat Avg Stdev Max
Latency (ms) 0.13 0.44 33
Req/Sec 45426.91 1279.75 46303
Bytes/Sec 5.06 MB 150.72 kB 5.24 MB
Overhead of turning on tracing with async_wrap
is around 8%, so the net overhead is 17%, mostly
this is the cost of writing to a stream.
The cost of turning stacks
and contexts
options on can also be determined with:
npm run benchmark-options
Overhead of enabling context is surprisingly low, 4580k reqs without contexts 4370k reqs with context - about 5% overhead (profiled on Node 6.1.0, Mac OS X 2013, 2.6ghz i7, 16gb).
However, YMMV based on real world usage. Another consideration of logging contexts is the log file size (although compression is likely to be quite effective).
Overhead of enabling stacks
is roughly the same as for enabling contexts
.
var http = require('http')
require('async-tracer')()
http.createServer(function (req, res) {
res.end('hello world')
}).listen(3000)
curl http://localhost:3000
npm test
MIT
Sponsored by nearForm
FAQs
Trace all async operations, output as newline delimited JSON logs, with minimal overhead.
The npm package async-tracer receives a total of 9 weekly downloads. As such, async-tracer popularity was classified as not popular.
We found that async-tracer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.