In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Fundebug backend Node.js plug-in updated to 0.2.0 whether to support monitoring Express slow requests, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Summary: performance issues are also BUG and need to be monitored.
Fundebug backend Node.js exception monitoring service
Fundebug is a professional application exception monitoring platform, our Node.js plug-in fundebug-nodejs can provide a full range of exception monitoring, support Express, Koa and Hapi framework.
From the user's point of view, the performance problem is also BUG to some extent, which may be the index problem of the database, the code algorithm problem, or the design of business logic. To help you quickly locate the performance BUG,fundebug-nodejs plug-in update to 0.2.0, support monitoring Express slow requests.
However, Fundebug has no intention of providing comprehensive performance monitoring services for the time being, and we will continue to focus on BUG monitoring.
Monitor Express slow request
To monitor Express slow requests, you need to configure the threshold httpTimeout and add ExpressTimeoutHandler middleware.
Fundebug.httpTimeout = 1000 * app.use (fundebug.ExpressTimeoutHandler ())
Note that Fundebug's slow request monitoring middleware ExpressTimeoutHandler must be placed before other middleware.
In this way, all requests that take longer than the threshold 1000ms are reported to Fundebug.
Fundebug-express-demo
For more information on how to connect Express to the Fundebug exception monitoring service, check out our Demo project fundebug-express-demo.
Const express = require ("express"); const app = express (); const port = 5000 const fundebug Const Promise = require ("bluebird"); const fundebug = require ("fundebug-nodejs"); fundebug.apikey = "APIKEY"; fundebug.httpTimeout = 1000 X app.use (fundebug.ExpressTimeoutHandler ()); app.get ("/ error", () = > {throw new Error ("test");}); app.get ("/ timeout", async (req, res) = > {await Promise.delay (1500) Res.sendStatus;}); app.use (function (err, req, res, next) {res.status (500); next (err);}); app.use (fundebug.ExpressErrorHandler); app.listen (port, () = > console.log (`Example app listening on port ${port}! `))
Among them, ExpressTimeoutHandler must be placed before other middleware, while ExpressErrorHandler must be placed after other middleware.
The timeout requests captured by Fundebug are as follows:
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.