Public Repository

Last pushed: 3 months ago
Short Description
A docker Ubuntu image with flame graph setup and examples
Full Description

Steps to create flame graph SVGs:

  1. Start the container in detached mode:

      docker run -dit --name flame_container -p 7070:7070 arpitrathore/flamegraph:1.00
    
  2. Start the container shell:

     docker exec -it flame_container /bin/bash
    
  3. Go to java directory and clean older svg and traces.txt files (if any):

     cd Flamegraph/java/
     rm traces.txt
     rm *.svg
    
  4. Run the Flame graph spring boot jar with profiler

     java -jar -agentpath:/Flamegraph/lightweight-java-profiler/build-64/liblagent.so flamegraph-springboot.jar
    
  5. Go to host OS browser and put this url in broswer and run multiple times (For more number of samples)

     http://localhost:7070/flamegraph/image?name=image2
     (Image name supported : image1, image2, image3)
    
  6. In docker container, terminate the Spring boot application (Cnt + C)

  7. The java profiler would have created trace file (traces.txt)

  8. Give this file as input to Flamegraph command to create SVG file

     ../FlameGraph/stackcollapse-ljp.awk < traces.txt | ../FlameGraph/flamegraph.pl > spring-boot.svg
    
  9. Copy this file to host OS file system (using a different power shell)

     docker cp flame_container:/Flamegraph/java/spring-boot.svg D:\Flamegraph
    
  10. Open the svg file in browser and visualize it.

Docker Pull Command
Owner
arpitrathore

Comments (0)