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

express-perf

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-perf - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

9

index.js

@@ -98,3 +98,2 @@ var https = require('https')

console.warn('[express-perf]', 'missing \'apiKey\'')
return
}

@@ -106,11 +105,7 @@

function finish () {
var method = req.method
var url = req.protocol + '://' + req.get('host') + req.originalUrl
var time = (new Date().getTime()) - startTime
var statusCode = res.statusCode
var data = {
ip_addr: req.headers['x-forwarded-for'] || req.connection.remoteAddress,
request_method: req.method,
request_url: req.protocol + '://' + req.get('host') + req.originalUrl,
normalized_uri: req.__baseRoute + req.route.path,
normalized_uri: (req.__baseRoute + req.route.path).replace(/:([^\/]*)/ig, '*'),
status_code: res.statusCode,

@@ -117,0 +112,0 @@ time_in_millis: (new Date().getTime()) - startTime

{
"name": "express-perf",
"version": "1.1.0",
"version": "1.2.0",
"description": "",

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

@@ -0,1 +1,29 @@

# express-perf
`express-perf` is small middleware that records performance timings and status codes from your app and sends it to Perf.
We then run analytics on that data to generate metrics and alerts.
Right now perf is in private beta but if you're interested in an API key, feel free to email us at [hi@perf.sh](hi@perf.sh)
## Usage
* Install `express-perf` using npm.
```
npm install express-perf --save
```
* In your Express application, include `express-perf` as a middleware
```
var express = require('express')
var perf = require('express-perf')
app.use(perf(express, {
apiKey: PERF_API_KEY
}))
```
* Make sure to include this _before_ you call your routes, preferably as your first middleware
* `require('express')` is just an example, you probably have already included this
* Make sure to replace `PERF_API_KEY` with the key given to you
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