Profiling¶
Profiling supports automatically obtaining the usage of CPU, memory, and I/O during the application runtime process. It displays in real-time the invocation relationships and execution efficiency of each method, class, and thread via flame graphs, helping to optimize code performance.
In the Profiling Explorer, you can:
- Analyze dynamic performance data of applications running under different language environments such as Java, Python, Go, and C/C++ using the Profiling flame graph. You can intuitively view performance issues related to CPU, memory, and I/O;
- Obtain code execution snippets associated with relevant Spans through linked traces, enabling method-level code performance tracking and helping developers identify directions for code optimization.
Prerequisites¶
Query and Analysis¶
After Profiling data is reported to the Guance workspace, you can use the Profiling real-time data explorer to understand your program's code performance. It supports querying and analyzing Profiling data, including search and filtering, quick filtering, adding display columns, and exporting data.
For more details, refer to Explorer Description.
Note: Profiling data is retained by default for 7 days.
Profiling Performance Analysis¶
Clicking on a Profiling list item allows you to view corresponding performance details, including attribute labels, performance flame graphs, and runtime information.
Flame Graphs and Dimensional Data Analysis¶
Profiling uses flame graphs to analyze the CPU, memory, or I/O usage at the code method level under different types. You can very clearly understand the execution performance and invocation status of methods. Additionally, Profiling provides execution data analysis based on dimensions such as methods, libraries, and threads, displaying more intuitively some methods with higher execution ratios, allowing quicker identification of performance issues.
Category | Description |
---|---|
CPU Time | The runtime of each method on the CPU. |
Wall Time | The time spent by each method, including the time running on the CPU, waiting for I/O, and any other events that occur during function execution. |
Heap Live Size | The amount of heap memory still in use. |
Allocated Memory | The amount of heap memory allocated by each method, including allocations later released. |
Allocations | The number of heap allocations performed by each method, including those later released. |
Thrown Exceptions | The number of exceptions thrown by each method. |
Lock Wait Time | The time each function spends waiting for locks. |
Locked Time | The time each function holds locks. |
Lock Acquires | The number of times each method acquires locks. |
Lock Releases | The number of times each method releases locks. |
Category | Description |
---|---|
CPU Time | The runtime of each method on the CPU, including service-related Java bytecode and runtime operation durations, excluding native code calls made through the JVM. |
Wall Time in Native Code | The sampling count for native code. When code runs on the CPU, waits for I/O, or any other situations occur during method execution, sampling may happen. This does not include Java bytecode calls involved in running application code. |
Allocations | The number of heap allocations performed by each method, including those later released. |
Allocated Memory | The amount of heap memory allocated by each method, including allocations later released. |
Heap Live Objects | The number of live objects allocated to each method. |
Thrown Exceptions | The number of exceptions thrown by each method. |
Lock Wait Time | The time each method spends waiting for locks. |
Lock Acquires | The number of times each method acquires locks. |
File I/O Time | The time each method spends reading from and writing to files. |
File I/O Written | The amount of data written to files by each method. |
File I/O Read | The amount of data read from files by each method. |
Socket I/O Read Time | The time each method spends reading from sockets. |
Socket I/O Write Time | The time each method spends writing to sockets. |
Socket I/O Read | The amount of data read from sockets by each method. |
Socket I/O Written | The amount of data written to sockets by each method. |
Synchronization | The time each method spends on synchronization. |
Quick Operations¶
- Search: You can perform fuzzy searches by entering keywords in the selection box to the right of Type. The selection box will list matching methods, allowing you to directly select the method you wish to view.
- Copy: You can copy the method details by hovering over them in the Dimension section.
- Click Selection: By default, all methods in Dimension are selected. You can click to view one or multiple methods and their related flame graph information. Clicking a method again restores the full selection.
Runtime Information¶
In the Profiling detail page, clicking to view Runtime Information allows you to see some information about the runtime of the corresponding programming language and label attributes. You can add label information to the explorer list for filtering purposes or copy the label content for query and search.
Trace Correlation with Profiling¶
When an application uses the ddtrace
collector and both APM trace tracking and Profiling performance tracking data collection are enabled simultaneously, Guance provides Span-level correlation viewing and analysis. In the trace detail page of the application performance monitoring, selecting a Span in the flame graph retrieves the code hotspot information for the corresponding time period, allowing you to directly view the list of code method invocations and the execution time and percentage of Wall Time within that time frame. In the method list, you can recursively view the order of method invocations and their execution times.
Clicking View Profiling Details redirects you to the corresponding Profiling detail page to view specific performance data.