Flame Graphs

    • How does consumption by one method compare to the others?

    Flame Graph

    Flame Graphs are constructed by sampling stack traces a number of times. Each method call is presented by a bar, where the length of the bar is proportional to the number of times it is present in the samples.

    Starting with Flink 1.13, Flame Graphs are natively supported in Flink. In order to produce a Flame Graph, navigate to the job graph of a running job, select an operator of interest and in the menu to the right click on the Flame Graph tab:

    Flame Graphs - 图2

    Apart from the On-CPU Flame Graphs, Off-CPU and Mixed visualizations are available and can be switched between by using the selector at the top of the pane:

    The Off-CPU Flame Graph visualizes blocking calls found in the samples. A distinction is made as follows:

    • On-CPU: in [RUNNABLE, NEW]

    Flame Graphs - 图4

    Mixed mode Flame Graphs are constructed from stack traces of threads in all possible states.

    Flame Graph in Mixed Mode

    The collection of stack traces is done purely within the JVM, so only method calls within the Java runtime are visible (no system calls).

    Flame Graph construction is performed at the level of an individual , i.e. all task threads of that operator are sampled in parallel and their stack traces are combined.

    There are plans to address this limitation in the future by providing “drill down” visualizations to the task level.