saz
saz

Reputation: 291

Profile NestJS functions on local/dev environment

I have a NestJS project with a bunch of functions that get called from the UI developed in Angular 11. I am trying to run the profiler on my local and dev environment but I can't figure out how to do that - V8 profiler/flame graphs. Any insight would be greatly appreciated. I am using IntelliJ and Jenkins pipeline to build and deploy the code to different environments.

Example: In the Nest JS project, we have an API with some functions.

msyAPI.ts

createMsy(....) {
// do stuff 
}

updateMsy(....) {
// do stuff 
}

calculateAge(....) {
// do stuff 
}

How can I run the profiler on this code to get performance metrics for each of the functions in msyAPI.ts? How do you put the code under load? Do I use the profiler on the Angular app or can I use it directly on the Nest JS code? Do I run the Angular web app on my local and then run the profiler while the UI is running? But that would be just one user hitting the API...

Sorry, I'm very new to this and haven't found much useful info online on how to profile the Nest JS API in a dev or stage or prod environment.

Thanks in advance.

Upvotes: 2

Views: 774

Answers (0)

Related Questions