Socket
Socket
Sign inDemoInstall

nstats

Package Overview
Dependencies
2
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.0 to 3.3.0

33

nstats.js

@@ -118,2 +118,3 @@ const fp = require('fastify-plugin')

res.raw.on('finish', () => {
req.raw.routerPath = req.routerPath;
this.addWeb(req.raw, res.raw, sTime);

@@ -162,10 +163,17 @@ });

{
var routerPath = req.routerPath || '_nstats_na';
if(!this.data.http[req.method])
if(!this.data.http[req.method]) {
this.data.http[req.method] = {};
}
if(!this.data.http[req.method][res.statusCode])
this.data.http[req.method][res.statusCode] = 0;
if(!this.data.http[req.method][res.statusCode]) {
this.data.http[req.method][res.statusCode] = {};
}
this.data.http[req.method][res.statusCode]++;
if(!this.data.http[req.method][res.statusCode][routerPath]) {
this.data.http[req.method][res.statusCode][routerPath] = 0;
}
this.data.http[req.method][res.statusCode][routerPath]++;
}

@@ -207,4 +215,17 @@ };

{
pstring += `
nstats_http{method="${methods[i]}",status="${status[j]}"} ${(this.data.http[methods[i]])[status[j]]}`;
var routes = Object.keys(this.data.http[methods[i]][status[j]]);
for (var k = 0; k < routes.length; k++) {
var route = routes[k];
if(route == '_nstats_na') {
pstring += `
nstats_http{method="${methods[i]}",status="${status[j]}"} ${(this.data.http[methods[i]])[status[j]]['_nstats_na']}`;
}
else {
pstring += `
nstats_http{method="${methods[i]}",status="${status[j]}",route="${route}"} ${(this.data.http[methods[i]])[status[j]][route]}`;
}
}
}

@@ -211,0 +232,0 @@ }

2

package.json
{
"name": "nstats",
"version": "3.2.0",
"version": "3.3.0",
"description": "A fast and compact way to get all your network and process stats for your node application.",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc