Urgent.News

What's breaking now, across thousands of outlets.

Tech

Good News For Backend And Devops Buddy

I shipped a Goated tool Today: API Performance Profiler. It answers one question backend devs ask every day: how fast is this route, actually? Most of us guess. Or we add console.time, or we open Postman and eyeball the number. Then we ship, and production tells us the truth. So I built something that measures instead: npm install @api-profiler/express app.use(profiler()); That's the whole setup.…

The backend development community can rejoice, as a new tool has been released to help measure API performance. The API Performance Profiler answers the common question of backend developers: how fast is this route actually performing? This tool eliminates the guesswork that often comes with estimating route performance. Instead of relying on console.time or eyeballing requests in Postman, developers can now install the npm package @api-profiler/express and use app.use(profiler()); to get accurate measurements.

Once requests have been sent, the profiler can be accessed via npx api-profiler, which presents a live table displaying every route, average latency, maximum response time, error rate, requests per second, and color-coded status indicators. What sets this tool apart is its ability to record and replay requests under load, providing a more accurate representation of how the route performs in real-world scenarios.

This feature is particularly useful for identifying performance bottlenecks and optimizing routes without the need for external tools or services.

The developer behind this innovative tool, Nahid625, has taken care to adhere to strict guidelines while building the API Performance Profiler. For instance, the tool only shows data that has been measured and never displays a number if there are insufficient samples. Latency and throughput are never mixed up, and load tests are performed only in the development environment, with GET requests only (unless a route is specifically opted into).

The profiler also ensures that no data leaves the developer's machine, emphasizing privacy and security.

In addition to the command-line interface, a VS Code extension is also in the works, which will display the performance metric (e.g., 84ms) directly next to the route line. This extension is set to be released on the VS Code marketplace this week. The API Performance Profiler is open-source and available under the AGPL license, allowing developers to review and contribute to the codebase at https://github.com/Nahid625/api-performance-profiler.

For those interested in trying the tool out on their actual projects, any issues or concerns can be reported via the provided GitHub issue tracker.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

What Makes You Trust an APK Download?

If you install Android apps outside Google Play, what makes you trust an APK? There are quite a few things I personally think matter: Who published the app? Is the developer clearly identified?

More from Sunday 20 September →