Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@moar-things/moar-profiler
Advanced tools
moar-profiler
is a command line program which can generate a CPU profile
for a Node.js program running with the --inspect
option.
The CPU profile data is produced from the V8 Profiler which collects timing samples of your functions and the stack frames they are executing in, while your program is running. The data can then be visualized in profiling tools, like Chrome Dev Tools.
moar-profiler
starts with that then, enriches that data with even moar!
You can use the online moar-profile-viewer to display that enriched profile data. Or just use any old profile viewer like Chrome Dev Tools, and it will just ignore the additional information.
Note that while moar-profiler
will run on versions of Node.js >= version 4,
it can only generate profiles for programs running on versions of Node.js >=
version 6. The Chrome Dev Tools inspector protocol is not available for
Node.js version 4.
moar-profiler [options] inspector-url
The inspector-url
parameter should be an http/s: url to a Node.js process
running with the inspector port open. When invoking node with the --inspect
option, it will use the port 9229, so the url would be http://localhost:9229
.
When the url protocol / hostname is http://localhost
, you can just provide the
port number instead of the complete url. So instead of http://localhost:9229
you can use 9229
as the url.
The generated profile will be written to stdout. Some tools require the
file extension of the profile to be .cpuprofile
, but the data in the file
is delicious, creamy JSON.
option | description |
---|---|
-d --duration | how long to profile the process (default: 5 seconds) |
-s --sampling | sample rate (default: 1000 microseconds) |
-h --help | print this help |
-v --version | print the program version |
Debug logging is enabled by setting the environment variable LOGLEVEL
to
debug
.
Example usage:
# start your application
node --inspect my
# run the profiler in another terminal
moar-profiler -d 3 9229 > my.moar.cpuprofile
const moarProfiler = require('moar-profiler')
...
const moarProfilerOptions = {
duration: 1 // seconds,
sampling: 1000 // microseconds
}
// run profile for specified # of seconds and send back err / profile object
moarProfiler.profile(null, options, (err, profileObject) => {
...
})
npm install -g @moar-things/moar-profiler
This package is licensed under the MIT license. See the LICENSE.md file for more information.
Awesome! We're happy that you want to contribute.
Please read the CONTRIBUTING.md file for more information.
FAQs
v8 cpu profiler with moar
The npm package @moar-things/moar-profiler receives a total of 7 weekly downloads. As such, @moar-things/moar-profiler popularity was classified as not popular.
We found that @moar-things/moar-profiler 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.