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

prom-client

Package Overview
Dependencies
Maintainers
1
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 5.0.0 to 5.0.1

6

lib/defaultMetrics.js

@@ -12,2 +12,3 @@ 'use strict';

var heapSizeAndUsed = require('./metrics/heapSizeAndUsed');
var register = require('./register');

@@ -41,3 +42,6 @@ var metrics = {

.map(function(metric) {
return metrics[metric]();
var defaultMetric = metrics[metric];
defaultMetric.metricNames.forEach(register.removeSingleMetric);
return defaultMetric();
});

@@ -44,0 +48,0 @@

@@ -5,2 +5,4 @@ 'use strict';

var NODEJS_EVENTLOOP_LAG = 'nodejs_eventloop_lag_milliseconds';
function reportEventloopLag(start, gauge) {

@@ -15,3 +17,3 @@ var delta = process.hrtime(start);

module.exports = function() {
var gauge = new Gauge('nodejs_eventloop_lag_milliseconds', 'Lag of event loop in milliseconds.');
var gauge = new Gauge(NODEJS_EVENTLOOP_LAG, 'Lag of event loop in milliseconds.');

@@ -23,1 +25,3 @@ return function() {

};
module.exports.metricNames = [NODEJS_EVENTLOOP_LAG];

10

lib/metrics/heapSizeAndUsed.js
'use strict';
var Gauge = require('../gauge');
var NODEJS_HEAP_SIZE_TOTAL = 'nodejs_heap_size_total_bytes';
var NODEJS_HEAP_SIZE_USED = 'nodejs_heap_size_used_bytes';
module.exports = function() {

@@ -10,4 +14,4 @@ if(typeof process.memoryUsage !== 'function') {

var heapSizeTotal = new Gauge('nodejs_heap_size_total_bytes', 'Process heap size from node.js in bytes.');
var heapSizeUsed = new Gauge('nodejs_heap_size_used_bytes', 'Process heap size used from node.js in bytes.');
var heapSizeTotal = new Gauge(NODEJS_HEAP_SIZE_TOTAL, 'Process heap size from node.js in bytes.');
var heapSizeUsed = new Gauge(NODEJS_HEAP_SIZE_USED, 'Process heap size used from node.js in bytes.');

@@ -22,1 +26,3 @@ return function() {

};
module.exports.metricNames = [NODEJS_HEAP_SIZE_TOTAL, NODEJS_HEAP_SIZE_USED];

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

var linuxVariant = require('./osMemoryHeapLinux');
var PROCESS_RESIDENT_MEMORY = 'process_resident_memory_bytes';
var notLinuxVariant = function() {
var residentMemGauge = new Gauge('process_resident_memory_bytes', 'Resident memory size in bytes.');
var residentMemGauge = new Gauge(PROCESS_RESIDENT_MEMORY, 'Resident memory size in bytes.');

@@ -20,1 +23,3 @@ return function() {

};
module.exports.metricNames = process.platform === 'linux' ? linuxVariant.metricNames : [PROCESS_RESIDENT_MEMORY];

@@ -8,2 +8,6 @@ 'use strict';

var PROCESS_RESIDENT_MEMORY = 'process_resident_memory_bytes';
var PROCESS_VIRTUAL_MEMORY = 'process_virtual_memory_bytes';
var PROCESS_HEAP = 'process_heap_bytes';
function structureOutput(input) {

@@ -35,5 +39,5 @@ var returnValue = {};

module.exports = function() {
var residentMemGauge = new Gauge('process_resident_memory_bytes', 'Resident memory size in bytes.');
var virtualMemGauge = new Gauge('process_virtual_memory_bytes', 'Virtual memory size in bytes.');
var heapSizeMemGauge = new Gauge('process_heap_bytes', 'Process heap size in bytes.');
var residentMemGauge = new Gauge(PROCESS_RESIDENT_MEMORY, 'Resident memory size in bytes.');
var virtualMemGauge = new Gauge(PROCESS_VIRTUAL_MEMORY, 'Virtual memory size in bytes.');
var heapSizeMemGauge = new Gauge(PROCESS_HEAP , 'Process heap size in bytes.');

@@ -53,1 +57,3 @@ return function() {

};
module.exports.metricNames = [PROCESS_RESIDENT_MEMORY, PROCESS_VIRTUAL_MEMORY, PROCESS_HEAP];
'use strict';
var Counter = require('../counter');
var PROCESS_CPU_SECONDS = 'process_cpu_seconds_total';

@@ -12,3 +13,3 @@ module.exports = function() {

var cpuUserCounter = new Counter('process_cpu_seconds_total', 'Total user and system CPU time spent in seconds.');
var cpuUserCounter = new Counter(PROCESS_CPU_SECONDS, 'Total user and system CPU time spent in seconds.');
var lastCpuUsage = null;

@@ -24,1 +25,3 @@

};
module.exports.metricNames = [PROCESS_CPU_SECONDS];

@@ -5,2 +5,4 @@ 'use strict';

var NODEJS_ACTIVE_HANDLES = 'nodejs_active_handles_total';
module.exports = function() {

@@ -13,3 +15,3 @@ // Don't do anything if the function is removed in later nodes (exists in node@6)

var gauge = new Gauge('nodejs_active_handles_total', 'Number of active handles.');
var gauge = new Gauge(NODEJS_ACTIVE_HANDLES, 'Number of active handles.');

@@ -20,1 +22,3 @@ return function() {

};
module.exports.metricNames = [NODEJS_ACTIVE_HANDLES];

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

var PROCESS_MAX_FDS = 'process_max_fds';
module.exports = function() {
var isSet = false;
var fileDescriptorsGauge = new Gauge('process_max_fds', 'Maximum number of open file descriptors.');
var fileDescriptorsGauge = new Gauge(PROCESS_MAX_FDS, 'Maximum number of open file descriptors.');

@@ -27,1 +29,3 @@ return function() {

};
module.exports.metricNames = [PROCESS_MAX_FDS];

@@ -6,2 +6,4 @@ 'use strict';

var PROCESS_OPEN_FDS = 'process_open_fds';
module.exports = function() {

@@ -13,3 +15,3 @@ if(process !== 'linux') {

var fileDescriptorsGauge = new Gauge('process_open_fds', 'Number of open file descriptors.');
var fileDescriptorsGauge = new Gauge(PROCESS_OPEN_FDS, 'Number of open file descriptors.');

@@ -27,1 +29,3 @@ return function() {

};
module.exports.metricNames = [PROCESS_OPEN_FDS];

@@ -5,3 +5,6 @@ 'use strict';

module.exports = function() { // Don't do anything if the function is removed in later nodes (exists in node@6)
var NODEJS_ACTIVE_REQUESTS = 'nodejs_active_requests_total';
module.exports = function() {
// Don't do anything if the function is removed in later nodes (exists in node@6)
if(typeof process._getActiveRequests !== 'function') {

@@ -12,3 +15,3 @@ return function() {

var gauge = new Gauge('nodejs_active_requests_total', 'Number of active requests.');
var gauge = new Gauge(NODEJS_ACTIVE_REQUESTS, 'Number of active requests.');

@@ -19,1 +22,3 @@ return function() {

};
module.exports.metricNames = [NODEJS_ACTIVE_REQUESTS];

@@ -6,4 +6,6 @@ 'use strict';

var PROCESS_START_TIME = 'process_start_time_seconds';
module.exports = function() {
var cpuUserGauge = new Gauge('process_start_time_seconds', 'Start time of the process since unix epoch in seconds.');
var cpuUserGauge = new Gauge(PROCESS_START_TIME, 'Start time of the process since unix epoch in seconds.');
var isSet = false;

@@ -19,1 +21,3 @@

};
module.exports.metricNames = [PROCESS_START_TIME];
{
"name": "prom-client",
"version": "5.0.0",
"version": "5.0.1",
"description": "Client for prometheus",

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

@@ -233,1 +233,5 @@ # Prometheus client for node.js [![Build Status](https://travis-ci.org/siimon/prom-client.svg?branch=master)](https://travis-ci.org/siimon/prom-client) [![Build status](https://ci.appveyor.com/api/projects/status/k2e0gwonkcee3lp9/branch/master?svg=true)](https://ci.appveyor.com/project/siimon/prom-client/branch/master)

```
### Garbage Collection
To avoid dependencies in this module, GC stats are kept outside of it. If you want GC stats, you can use https://github.com/SimenB/node-prometheus-gc-stats
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