-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation on using nodejs profiling (#2143)
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# NodeJS Profiling | ||
|
||
NodeJS provides a built-in profiler which allows developer to analyse and optimise their code. Official documentation and in-depth details can be found [here](https://nodejs.org/en/docs/guides/simple-profiling). | ||
|
||
## Summary of how to: | ||
1. Start WebUI server that is to be investigated with: `node --prof index.js` | ||
2. Execute for a few times at an interval the user scenarios that are suspected to be causing a big stress on the server. During this time, NodeJS will automatically create and update a file with the analysis details while the server is running. | ||
3. Once done, stop the server. | ||
4. Use the NodeJS generated log file prefixed with `isolate-` to get a report of the activities by running: `node --prof-process isolate-<rest_of_log_file_name>.log > processed.txt` | ||
5. Open the `processed.txt` file in your preferred editor, analyse the `[Summary]` section and identify `Components/Sub-Sections` that have a high number of `ticks` or increased percentage from the total. | ||
6. Proceed to analyse sub-sections that appear to be taking lots of resources. |