googleapis/cloud-profiler-nodejs

no line numbers?

jasonswearingen opened this issue · 2 comments

I tried out the profiler and it looks interesting, but I don't see line numbers listed in the output.

Additionally, I don't see any line numbers when looking at the screenshots shown here: https://cloud.google.com/profiler/docs/using-profiler

However, a number of the issues in this repo's tracker mentions improving line numbers... is there something I'm missing? I need line numbers because my output has a lot of (anonymous) stacks so quite hard to track down without an actual line number for the fcn.

There is some line number information currently available in the the Node.js profiles. However, the line number information is not currently displayed in the Stackdriver Profiler UI. Also, line numbers in the profile refer to the first line of the function, rather than the line from which the next function in the stack was called or the line number where time was spent or memory was allocated.

It sounds like the existing line numbers should still be helpful for you, though.

To view profile line number information, you can download the profile:
image

And use the pprof command line tool (for example pprof -http=: -lines /path/to/profile.pb.gz) to view the profile data. This command line tool is also vendored into golang, and can be called using the command go tool pprof.

thank you for the reply. Yes if possible to show actual line numbers (even just of the function entrypoint) in the UI, it would be a really great improvement.

I have been trying various NodeJs profilers in the last few days and the Stackdriver Profiler has the most clear and actionable information, which I find surprising as it seems to be sampling based.

FYI I was considering trying pprof but didn't want to go down the rabbit-hole of getting go working. now that I know this will somewhat solve my issue I'll give it a try if needed (I was able to guess my way to solving my current perf problems without linenumbers)