Search code examples
javajfr

if I have multiple Java flight recorder files (.JFR) , how do I merge them together to see them at Java mission control in one time


I received for analysis a bunch of multiple JFR files , like 170 , and it is taking too long to open one by one, can I put them in one single file, starting from the fact that I only have the files and I cannot configure the JVM and obtain the JFR again. for example

  • 2020_03_30_20_37_01_2333_0.jfr
  • 2020_03_30_21_37_01_2333_0.jfr
  • 2020_03_30_22_37_01_2333_0.jfr
  • 2020_03_30_23_37_01_2333_0.jfr

    . . .

  • N

Solution

  • You can use the 'jfr' tool located in JDK_HOME/bin from 11.06 or later.

    $ jfr assemble <repository> <file>
    

    where repository is the directory where the files are located and file is the name of the recording file (.jfr) to create.

    A recording file is just a concatenation of chunk files so you could do it in the shell as well. For example, using the copy /b command in Windows

     $ copy /b 1.jfr + 2.jfr + 3.jfr combined.jfr