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 6.2.0 to 6.3.0

24

lib/metrics/processCpuTotal.js
'use strict';
var Counter = require('../counter');
var PROCESS_CPU_USER_SECONDS = 'process_cpu_user_seconds_total';
var PROCESS_CPU_SYSTEM_SECONDS = 'process_cpu_system_seconds_total';
var PROCESS_CPU_SECONDS = 'process_cpu_seconds_total';

@@ -13,3 +15,9 @@

var cpuUserCounter = new Counter(PROCESS_CPU_SECONDS, 'Total user and system CPU time spent in seconds.');
var cpuUserUsageCounter = new Counter(PROCESS_CPU_USER_SECONDS,
'Total user CPU time spent in seconds.');
var cpuSystemUsageCounter = new Counter(PROCESS_CPU_SYSTEM_SECONDS,
'Total system CPU time spent in seconds.');
var cpuUsageCounter = new Counter(PROCESS_CPU_SECONDS,
'Total user and system CPU time spent in seconds.');
var lastCpuUsage = process.cpuUsage();

@@ -19,10 +27,16 @@

var cpuUsage = process.cpuUsage();
var totalUsageMicros = (cpuUsage.user - lastCpuUsage.user)
+ (cpuUsage.system - lastCpuUsage.system);
var userUsageMicros = cpuUsage.user - lastCpuUsage.user;
var systemUsageMicros = cpuUsage.system - lastCpuUsage.system;
lastCpuUsage = cpuUsage;
cpuUserCounter.inc(totalUsageMicros / 1e6);
cpuUserUsageCounter.inc(userUsageMicros / 1e6);
cpuSystemUsageCounter.inc(systemUsageMicros / 1e6);
cpuUsageCounter.inc((userUsageMicros + systemUsageMicros) / 1e6);
};
};
module.exports.metricNames = [PROCESS_CPU_SECONDS];
module.exports.metricNames = [
PROCESS_CPU_USER_SECONDS, PROCESS_CPU_SYSTEM_SECONDS, PROCESS_CPU_SECONDS
];
{
"name": "prom-client",
"version": "6.2.0",
"version": "6.3.0",
"description": "Client for prometheus",

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

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