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.
monitor-dog
Advanced tools
Wraps dogstatsd to provide environment based event scoping (prefixing) and timers.
// Assume `process.env.MONITOR_PREFIX === 'myProject'`, then all events
// triggered via monitor dog will be prefixed with `myProject.`.
var monitor = require('monitor-dog');
// Trigger an increment (`myProject.requests`)
monitor.increment('requests');
// Trigger a gauge event (`myProject.404s`)
monitor.gauge('404s');
// Time requests...
var timer = monitor.timer('request.time');
request('http://example.com', function(req, res) {
// Triggers a histogram event to `myProject.request.time`
timer.stop();
});
These methods behave exactly as you would expect on a regular dogstatsd Client.
Creates and returns new timer with the given name
. Optional boolean
startNow
can be provided to start the timer at a later date using the
.start
method.
// Create the timer
var sumTimer = monitor.timer('sum.time');
// Perform a computation
var sum = 0;
for (var i = 0; i < 1000000; i++) {
sum += i;
}
// Call .stop() to send a histogram event named 'sum.time'
// with the recorded duration...
sumTimer.stop();
var requestTimer = monitor.timer('request.time');
request('/some/endpoint', function (err, res) {
requestTimer.stop();
});
var delayedTime = monitor.timer('delayed.timer', false);
// ... Do some other stuff ...
delayedTimer.start();
// ... Do some more stuff ...
delayedTimer.stop();
MIT
FAQs
A helpful wrapper for dogstatsd.
The npm package monitor-dog receives a total of 4 weekly downloads. As such, monitor-dog popularity was classified as not popular.
We found that monitor-dog 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.