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

statful-client

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

statful-client - npm Package Compare versions

Comparing version 4.1.2 to 4.1.3

23

lib/client.js

@@ -7,3 +7,3 @@ 'use strict';

URL = require('url'),
httpsAgent = new https.Agent({ keepAlive: true }),
httpsAgent = new https.Agent({ maxSockets: 50, keepAlive: true }),
merge = require('merge'),

@@ -76,11 +76,16 @@ zlib = require('zlib'),

req.setTimeout(options.timeout);
req.on('error', function(e) {
logger.error('An error occurred: ' + e.message);
if (e.code === "ECONNRESET") {
logger.error('A timeout occurred on a request to host: ' + options.hostname +
' port: ' + options.port + ' and path: ' + options.path);
} else {
logger.error('An error occurred: ' + e.message);
}
});
req.on('timeout', function(){
logger.error('A timeout occurred on a request to host: ' + options.hostname +
' port: ' + options.port + ' and path: ' + options.path);
req.on('socket', function (socket) {
socket.setTimeout(options.timeout);
socket.on('timeout', function() {
req.abort();
});
});

@@ -269,3 +274,5 @@

if ( (self.aggregatedBuffer.bufferSize + self.nonAggregatedBuffer.bufferSize) >= self.flushSize) {
flush(self);
setTimeout(function() {
flush(self);
}, 0);
}

@@ -272,0 +279,0 @@ } else {

@@ -13,3 +13,3 @@ {

},
"version": "4.1.2",
"version": "4.1.3",
"engines": {

@@ -16,0 +16,0 @@ "node": ">=0.8"

@@ -551,5 +551,7 @@ 'use strict';

// Then
expect(victim.logger.debug.getCall(0).args[0]).to.match(/^Flushing metrics \(non aggregated\): application.my_metric 1 \d+$/);
victim.logger.debug.restore();
done();
setTimeout(function () {
expect(victim.logger.debug.getCall(0).args[0]).to.match(/^Flushing metrics \(non aggregated\): application.my_metric 1 \d+$/);
victim.logger.debug.restore();
done();
});

@@ -576,5 +578,7 @@ });

// Then
expect(victim.logger.debug.getCall(0).args[0]).to.match(/^Flushing metrics \(aggregated\): application.my_metric 1 \d+\napplication\.my_metric 1 \d+$/);
victim.logger.debug.restore();
done();
setTimeout(function () {
expect(victim.logger.debug.getCall(0).args[0]).to.match(/^Flushing metrics \(aggregated\): application.my_metric 1 \d+\napplication\.my_metric 1 \d+$/);
victim.logger.debug.restore();
done();
});

@@ -601,7 +605,8 @@ });

// Then
expect(victim.logger.debug.getCall(0).args[0]).to.match(/^Flushing metrics \(non aggregated\): application.my_metric 1 \d+$/);
expect(victim.logger.debug.getCall(1).args[0]).to.match(/^Flushing metrics \(aggregated\): application.my_metric 1 \d+\napplication\.my_metric 1 \d+$/);
victim.logger.debug.restore();
done();
setTimeout(function () {
expect(victim.logger.debug.getCall(0).args[0]).to.match(/^Flushing metrics \(non aggregated\): application.my_metric 1 \d+$/);
expect(victim.logger.debug.getCall(1).args[0]).to.match(/^Flushing metrics \(aggregated\): application.my_metric 1 \d+\napplication\.my_metric 1 \d+$/);
victim.logger.debug.restore();
done();
});
});

@@ -625,6 +630,7 @@

// Then
expect(victim.logger.debug.getCall(1).args[0]).to.be.equal('Can\'t flush aggregated metrics using udp transport.');
expect(victim.aggregatedBuffer.bufferSize).to.be.equal(0);
victim.logger.debug.restore();
done();
setTimeout(function () {
expect(victim.logger.debug.getCall(1).args[0]).to.be.equal('Can\'t flush aggregated metrics using udp transport.');
expect(victim.aggregatedBuffer.bufferSize).to.be.equal(0);
done();
});

@@ -631,0 +637,0 @@ });

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