Socket
Socket
Sign inDemoInstall

aggregate-metric-logger

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aggregate-metric-logger - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0

2

package.json
{
"name": "aggregate-metric-logger",
"version": "1.7.1",
"version": "1.8.0",
"description": "aggregate metrics in memory for logging",

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

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

module.exports = ({ enabled = true, namespace = 'aggregate-metric-logger' } = {}) => {
module.exports = ({
enabled = true,
namespace = 'aggregate-metric-logger',
inProgressMeasurementWarningLimit = 10000
} = {}) => {
const logger = loggerFactory(namespace);

@@ -21,2 +25,5 @@

logMetrics();
if (Object.keys(measurements).length > inProgressMeasurementWarningLimit) {
logger.warn('too-many-in-progress-metric-log-measurments');
}
metrics = {};

@@ -23,0 +30,0 @@ setupNextFlush();

@@ -256,2 +256,14 @@ 'use strict';

});
it('should log warning if there are too many measurments in progress', () => {
jest.spyOn(Logger.prototype, 'warn');
const metricLogger = metricLoggerFactory({ inProgressMeasurementWarningLimit: 1 });
metricLogger.measure('kacsa');
metricLogger.start('nyavogas');
metricLogger.start('nyavogas');
clock.tick(60 * 1000);
expect(Logger.prototype.warn).toBeCalledWith('too-many-in-progress-metric-log-measurments');
});
});

@@ -258,0 +270,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