Spring Startup Actuator to Collapsed Stack converter

Overview

Spring Startup To Collapse Stack

spring-startup-to-collapse-stack is CLI tool converting output of startup endpoint to collapse stack format. Collapsed stack can be converted to the flame graph with help of AsyncProfiler.

Motivation

Spring Boot allows to gather startup metrics since version 2.4.0 (actuator docs, Spring Boot docs, Spring Framework docs). However there is lack of tool to visualize where our Spring Boot app spends time during the startup. Startup events could be gathered by JFR events and shown in JDK Mission Control: img/jdk-mission-control.png or can be listed by actuator as a json:

{
  "springBootVersion": "2.5.4",
  "timeline": {
    "startTime": "2021-10-09T17:35:50.813987Z",
    "events": [
      {
        "endTime": "2021-10-09T17:35:50.899008Z",
        "duration": 0.021545,
        "startupStep": {
          "name": "spring.boot.application.starting",
          "id": 0,
          "tags": [
            {
              "key": "mainApplicationClass",
              "value": "com.github.wyhasany.Application"
            }
          ]
        },
        "startTime": "2021-10-09T17:35:50.877463Z"
      },
      "..."
    ]
  }
}

Both approaches are troublesome to analyze that data.

We can reinvent the wheel and create new visualization tool as it was tried before ( [1], [2], [3]). Or we can reuse flame graphs which ideally fits for that purpose. That approach has been chosen by this project.

Example generated flame graph: img/flamegraph.png

Usage

Spring configuration

Configure your app to collect startup events:

@SpringBootApplication
public class App {
    public static void main(String[] args) {
        new SpringApplicationBuilder()
            .applicationStartup(new BufferingApplicationStartup(2048))
            .sources(Application.class)
            .run(args);
    }
}

Download startup json

curl localhost:8091/actuator/startup > startup.json

Download spring-startup-to-collapse-stack converter

curl -L https://github.com/wyhasany/spring-startup-to-collapse-stack/releases/download/0.1-alpha/converter-spring-boot-startup.jar --output converter-spring-boot-startup.jar

Convert startup.json to collapse format

Keep in mind to use JDK 16

java -jar converter-spring-boot-startup.jar startup.json startup.collapse

Convert collapse format to HTML 5 Flame Graph

# Download async-profiler's converter
curl -L https://github.com/jvm-profiling-tools/async-profiler/releases/download/v2.5/converter.jar --output converter.jar
# convert to flame graph
java -cp converter.jar FlameGraph startup.collapse output.html

Open it in browser and explore as other Flame Graphs.

Note:

Shown samples actually refers to the duration µseconds of given step.

You might also like...

A simple tool to get method stack

A simple tool to get method stack

Jan 17, 2022

Curso da Stack Quarkus - Alura

bitcoin Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website:

Oct 29, 2021

CO1212 - Stack Operations Activity

StackOperations Download this two java files and implement the methods which are mentioned inside the class. Just use the basic things that I have tau

Apr 26, 2022

Construction System is a Ecommerce Full stack web development project.

Construction-system- Construction System is a Ecommerce Full stack web development project. Construction System is a project to ensure that there is a

Oct 17, 2021

Projeto final curso Let's Code Web Full Stack

Projeto final curso Let's Code Web Full Stack

E-Commerce Description Microservices-based backend application to manage an e-commerce. Please see the project statement (pt-BR) for details. How-To R

May 31, 2022

一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024

友情提示:因为提供了 50000+ 行示例代码,所以艿艿默认注释了所有 Maven Module。 胖友可以根据自己的需要,修改 pom.xml 即可。 一个涵盖六个主流技术栈的正经仓库: 《Spring Boot 专栏》 《Spring Cloud Alibaba 专栏》 《Spring Clou

Dec 31, 2022

参考 DDD/Clean Architecture 设计理念,整合 Spring Boot/Spring Security/Mybatis Plus/Vavr 的 Spring Realworld 应用案例

参考 DDD/Clean Architecture 设计理念,整合 Spring Boot/Spring Security/Mybatis Plus/Vavr 的 Spring Realworld 应用案例

Demo · 更多项目 · 参考资料 ms-spring-ddd-examples Unified Domain-driven Layered Architecture for MicroService Apps,试图探索一套切实可行的应用架构规范,可以复制、可以理解、可以落地、可以控制复杂性的指导

Sep 23, 2022

Spring Kurulumundan Başlayarak, Spring IOC ve Dependency Injection, Hibernate, Maven ve Spring Boot Konularına Giriş Yapıyoruz.

Spring Kurulumundan Başlayarak, Spring IOC ve Dependency Injection, Hibernate, Maven ve Spring Boot Konularına Giriş Yapıyoruz.

Spring Tutorial for Beginners File Directory Apache Tomcat Apache Tomcat - Eclipse Bağlantısı Spring Paketlerinin İndirilmesi ve Projeye Entegrasyonu

Apr 11, 2022

Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

Dec 20, 2022
Releases(0.1-alpha)
Owner
Michał Rowicki
Michał Rowicki
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
Spring Boot Full Stack with React for Professionals

Spring Boot allows to take an idea/prototype and turn it into a real thing in matters minutes hours of months and years. A lot of companies use Spring Boot because it's easy to setup, learn and write code very fast without having to setup the low level platform code

Amigoscode 318 Dec 29, 2022
Spring Boot Full Stack with React for Professionals

Spring Boot allows to take an idea/prototype and turn it into a real thing in matters minutes hours of months and years. A lot of companies use Spring Boot because it's easy to setup, learn and write code very fast without having to setup the low level platform code. Recently, Netflix has decided to switch their entire backend to Spring Boot.

Amigoscode 26 Mar 25, 2021
In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend

In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend. We will use MySQL database to store and retrieve the data.

Ramesh Fadatare 43 Dec 22, 2022
Full Stack Employee Management Application Using ReactJS and Spring Boot

Full Stack Employee Management Application Using ReactJS and Spring Boot Tech We Used ReactJs Spring Boot MySql Database Spring Security REST API Feat

Alan Binu 53 Nov 18, 2022
Coupon Management System - Full-Stack Project Based in Spring & React

Coupon Management System Full-Stack Project Based in Spring & React Coupon Management System: Final project by Shachaf Izhaki. This project was built

null 1 Jan 9, 2022
The goal of the project is to create a web application using Java EE and database (PostgreSQL) without connecting a modern technology stack like spring boot and hibernate

About The Project SignIn page SignUp page Profile page The goal of the project is to create a web application using Java EE and database (PostgreSQL)

Islam Khabibullin 2 Mar 23, 2022
DSMovie is a full stack web and mobile application built during Spring React Week, an event organized by DevSuperior

projeto-DSMovie Sobre o projeto DSMovie é uma aplicação full stack web e mobile construída durante a Semana Spring React, evento organizado pela DevSu

Matheus Maia Alvarez 7 Apr 18, 2022
该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的线上博客项目/企业大型商城系统/前后端分离实践项目等,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

Spring Boot Projects 该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前

十三 4.5k Dec 30, 2022
Desafio numero 015 correspondiente al finalización del curso 01 de la carrera Java Full Stack de la academia Desafío LATAM

DesafioFinalProgramacionBasicaJava Desafio numero 015 correspondiente al finalización del curso 01 de la carrera Java Full Stack de la academia Desafí

null 1 Feb 17, 2022