Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

monitor-dog

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monitor-dog - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "monitor-dog",
"version": "1.0.0",
"version": "1.0.1",
"description": "A helpful wrapper for dogstatsd.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -32,1 +32,55 @@ # monitor-dog

```
## Documentation
### .set, .increment, .histogram, .gauge
These methods behave exactly as you would expect on a regular
[dogstatsd Client](https://www.npmjs.com/package/node-dogstatsd).
### .timer(name, [startNow])
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.
##### Synchronous
```js
// 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();
```
##### Asynchronous
```js
var requestTimer = monitor.timer('request.time');
request('/some/endpoint', function (err, res) {
requestTimer.stop();
});
```
##### Delayed Use
```js
var delayedTime = monitor.timer('delayed.timer', false);
// ... Do some other stuff ...
delayedTimer.start();
// ... Do some more stuff ...
delayedTimer.stop();
```
## License
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc