epm
@byu-oit/express-profiler-middleware
npm i @byu-oit/express-profiler-middleware
epm

@byu-oit/express-profiler-middleware

An express middleware function for profiling client requests

by Brigham Young University

0.1.1 (see all)License:Apache-2.0TypeScript:Not FoundCategories:Express Profiling
npm i @byu-oit/express-profiler-middleware
Readme

Express Profiler Middleware

An Express middleware function for profiling client requests using the v8 profiler (See v8-profiler-next).

Usage Example

const express = require('express')
const profiler = require('@byu-oit/express-profiler-middleware')

const app = express()

app.use(profiler.middleware((req, profile) => {
  const fileName = `${Date.now().toString()}-${req.method}${req.path.split('/').join('-')}.cpuprofile`
  profile.export((error, result) => fs.writeFileSync(fileName, result))
}))

app.get('/xhealth', (req, res) => {
  setTimeout(() => res.sendStatus(200), 250)
})

let port = process.env.PORT || 8080
app.listen(port, () => console.log(`Server listening on port ${port}`))

Downloads/wk

0

GitHub Stars

0
No data available

LAST COMMIT

NaNyrs ago

MAINTAINERS

15

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
No data available
VersionTagPublished
0.1.1
latest
2yrs ago
No tutorials found
Add a tutorial