-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Go pprof allows a way to see profiles in a text based format. This is very useful when you have hundreds of profiles to analyze and you want to find the specific instance that has the most code in a specific function.
On the other hand, trace only allows to do UI analysis. Then if I have hundreds of traces I need to go one by one and traces can take several seconds if not minutes to load. To put a "real" example, I recently had to find why we were having long GC pauses, but these GC pauses were only happening in 1-3 instances once in a while (3-5 minutes). I was able to find the pattern to run a complete horizontal tracing of it, but after that I needed to analyze ~64 90 seconds traces.
What I ended up doing was to copy the source code from internal/trace and manually create a function that only returned the data that I wanted. Once I got the instance with the highest GC pause I fallback to the normal way of loading a trace in the UI and I was able to find the source of the problem.
The proposal/ask is if the community has considered exposing some of the APIs under internal/trace? Or provide a text based command line approach for the trace command?