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

prom-client

Package Overview
Dependencies
Maintainers
2
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prom-client - npm Package Compare versions

Comparing version 11.3.0 to 11.4.0

lib/metrics/helpers/processMetricsHelpers.js

7

CHANGELOG.md

@@ -16,2 +16,9 @@ # Changelog

## [11.4.0] - 2019-06-04
### Added
- `nodejs_active_handles` metric to the `collectDefaultMetrics()`. Unlike `nodejs_active_handles_total` it split count of active handles by type.
- `nodejs_active_requests` metric to the `collectDefaultMetrics()`. Unlike `nodejs_active_requests_total` it split count of active requests by type.
## [11.3.0] - 2019-04-02

@@ -18,0 +25,0 @@

23

lib/metrics/processHandles.js
'use strict';
const { aggregateByObjectName } = require('./helpers/processMetricsHelpers');
const { updateMetrics } = require('./helpers/processMetricsHelpers');
const Gauge = require('../gauge');
const NODEJS_ACTIVE_HANDLES = 'nodejs_active_handles_total';
const NODEJS_ACTIVE_HANDLES = 'nodejs_active_handles';
const NODEJS_ACTIVE_HANDLES_TOTAL = 'nodejs_active_handles_total';

@@ -17,11 +20,23 @@ module.exports = (registry, config = {}) => {

name: namePrefix + NODEJS_ACTIVE_HANDLES,
help: 'Number of active handles.',
help:
'Number of active libuv handles grouped by handle type. Every handle type is C++ class name.',
labelNames: ['type'],
registers: registry ? [registry] : undefined
});
const totalGauge = new Gauge({
name: namePrefix + NODEJS_ACTIVE_HANDLES_TOTAL,
help: 'Total number of active handles.',
registers: registry ? [registry] : undefined
});
return () => {
gauge.set(process._getActiveHandles().length, Date.now());
const handles = process._getActiveHandles();
updateMetrics(gauge, aggregateByObjectName(handles));
totalGauge.set(handles.length, Date.now());
};
};
module.exports.metricNames = [NODEJS_ACTIVE_HANDLES];
module.exports.metricNames = [
NODEJS_ACTIVE_HANDLES,
NODEJS_ACTIVE_HANDLES_TOTAL
];

25

lib/metrics/processRequests.js
'use strict';
const Gauge = require('../gauge');
const { aggregateByObjectName } = require('./helpers/processMetricsHelpers');
const { updateMetrics } = require('./helpers/processMetricsHelpers');
const NODEJS_ACTIVE_REQUESTS = 'nodejs_active_requests_total';
const NODEJS_ACTIVE_REQUESTS = 'nodejs_active_requests';
const NODEJS_ACTIVE_REQUESTS_TOTAL = 'nodejs_active_requests_total';

@@ -17,11 +19,24 @@ module.exports = (registry, config = {}) => {

name: namePrefix + NODEJS_ACTIVE_REQUESTS,
help: 'Number of active requests.',
help:
'Number of active libuv requests grouped by request type. Every request type is C++ class name.',
labelNames: ['type'],
registers: registry ? [registry] : undefined
});
const totalGauge = new Gauge({
name: namePrefix + NODEJS_ACTIVE_REQUESTS_TOTAL,
help: 'Total number of active requests.',
registers: registry ? [registry] : undefined
});
return () => {
gauge.set(process._getActiveRequests().length, Date.now());
const requests = process._getActiveRequests();
updateMetrics(gauge, aggregateByObjectName(requests));
totalGauge.set(requests.length, Date.now());
};
};
module.exports.metricNames = [NODEJS_ACTIVE_REQUESTS];
module.exports.metricNames = [
NODEJS_ACTIVE_REQUESTS,
NODEJS_ACTIVE_REQUESTS_TOTAL
];
{
"name": "prom-client",
"version": "11.3.0",
"description": "Client for prometheus",
"main": "index.js",
"files": [
"lib/",
"index.js",
"index.d.ts"
],
"engines": {
"node": ">=6.1"
},
"scripts": {
"benchmarks": "node ./benchmarks/index.js",
"test": "npm run lint && npm run compile-typescript && npm run test-unit",
"lint": "eslint .",
"test-unit": "jest",
"compile-typescript": "tsc index.d.ts --noImplicitAny --target es6"
},
"repository": {
"type": "git",
"url": "git@github.com:siimon/prom-client.git"
},
"keywords": [
"Prometheus",
"Metrics",
"Client"
],
"author": "Simon Nyberg",
"license": "Apache-2.0",
"homepage": "https://github.com/siimon/prom-client",
"devDependencies": {
"@clevernature/benchmark-regression": "^1.0.0",
"eslint": "^5.6.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.0.1",
"express": "^4.13.3",
"husky": "^1.3.1",
"jest": "^23.6.0",
"lint-staged": "^7.0.0",
"lolex": "^3.0.0",
"prettier": "1.15.3",
"typescript": "^3.0.3"
},
"dependencies": {
"tdigest": "^0.1.1"
},
"types": "./index.d.ts",
"jest": {
"testEnvironment": "node",
"testRegex": ".*Test\\.js$"
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
],
"*.{ts,md,json,yml}": [
"prettier --write",
"git add"
],
".{eslintrc,travis.yml}": [
"prettier --write",
"git add"
]
},
"prettier": {
"singleQuote": true,
"useTabs": true,
"overrides": [
{
"files": "*.md",
"options": {
"useTabs": false
}
},
{
"files": ".eslintrc",
"options": {
"parser": "json"
}
}
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
"name": "prom-client",
"version": "11.4.0",
"description": "Client for prometheus",
"main": "index.js",
"files": [
"lib/",
"index.js",
"index.d.ts"
],
"engines": {
"node": ">=6.1"
},
"scripts": {
"benchmarks": "node ./benchmarks/index.js",
"test": "npm run lint && npm run compile-typescript && npm run test-unit",
"lint": "eslint .",
"test-unit": "jest",
"compile-typescript": "tsc index.d.ts --noImplicitAny --target es6"
},
"repository": {
"type": "git",
"url": "git@github.com:siimon/prom-client.git"
},
"keywords": [
"Prometheus",
"Metrics",
"Client"
],
"author": "Simon Nyberg",
"license": "Apache-2.0",
"homepage": "https://github.com/siimon/prom-client",
"devDependencies": {
"@clevernature/benchmark-regression": "^1.0.0",
"eslint": "^5.6.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.0.1",
"express": "^4.13.3",
"husky": "^1.3.1",
"jest": "^23.6.0",
"lint-staged": "^7.0.0",
"lolex": "^3.0.0",
"prettier": "1.15.3",
"typescript": "^3.0.3"
},
"dependencies": {
"tdigest": "^0.1.1"
},
"types": "./index.d.ts",
"jest": {
"testEnvironment": "node",
"testRegex": ".*Test\\.js$"
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
],
"*.{ts,md,json,yml}": [
"prettier --write",
"git add"
],
".{eslintrc,travis.yml}": [
"prettier --write",
"git add"
]
},
"prettier": {
"singleQuote": true,
"useTabs": true,
"overrides": [
{
"files": "*.md",
"options": {
"useTabs": false
}
},
{
"files": ".eslintrc",
"options": {
"parser": "json"
}
}
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
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