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

monitor-dog

Package Overview
Dependencies
Maintainers
2
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.4.1 to 1.5.0

5

lib/monitor.js

@@ -207,8 +207,9 @@ 'use strict';

* default: `true`.
* @param {Object} [tags] Optional tags for the event.
* @return {Timer} Timer object that can be stopped when timing is finished.
*/
Monitor.prototype.timer = function (histName, start) {
Monitor.prototype.timer = function (histName, start, tags) {
var self = this;
return new Timer(function (duration) {
self.histogram(histName, duration);
self.histogram(histName, duration, tags);
}, start);

@@ -215,0 +216,0 @@ };

2

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

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

@@ -54,2 +54,15 @@ 'use strict';

it('should call client histogram method with correct name when stopped', function (done) {
var timerName = 'timer';
var timerTags = { tag1: 'one' }
monitor.client.histogram.restore();
sinon.stub(monitor.client, 'histogram', function (name, duration, tags) {
expect(name).to.equal(monitor.prefix + '.' + timerName);
expect(tags).to.deep.equal([ 'tag1:one' ])
done();
});
var timer = monitor.timer(timerName, true, timerTags);
timer.stop();
});
it('should report a realistic duration when stopped', function (done) {

@@ -56,0 +69,0 @@ var duration = 60;

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