Skip to content

maistrovyi/spring-boot-profiling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-profiling

Clojars Project

Motivation

I wanted to create this spring-boot extention because it's a simple and useful code if you need to measure execution time of the methods. If your task doesn't require large benchmarks - then this will suit you! I enjoy programming in Clojure.

Besides, I wanted to:

  • improve my skills in Clojure
  • eventually find some time to do something open-source
  • have a good time!

Usage

Maven:

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>
<dependency>
  <groupId>com.maystrovyy</groupId>
  <artifactId>spring-boot-profiling</artifactId>
  <version>0.0.5</version>
</dependency>

Gradle:

maven { url "http://clojars.org/repo"}
compile "com.maystrovyy:spring-boot-profiling:0.0.5"

Dependencies

Parent is spring-boot-1.5.5, so I advise you to remove duplicates, such as:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
  <groupId>org.projectlombok</groupId>
  <artifactId>lombok</artifactId>
</dependency>

Also, you can get only src and use it on any logging and aop framework.

Output

As a result you'll see this:

2017-07-09 17:49:34.268  INFO 1441 --- [  restartedMain] com.maystrovyy.aspect.ProfilingAspect    : Profiling in class com.maystrovyy.HelloWorld method: sayHello started...
2017-07-09 17:50:24.242  INFO 1441 --- [  restartedMain] com.maystrovyy.aspect.ProfilingAspect    : Execution time in class com.maystrovyy.HelloWorld method: sayHello = n seconds.

or

2017-07-09 17:49:34.268  INFO 1441 --- [  restartedMain] com.maystrovyy.aspect.ProfilingAspect    : Profiling in class com.maystrovyy.HelloWorld method: sayHello started...
2017-07-09 17:50:24.242  INFO 1441 --- [  restartedMain] com.maystrovyy.aspect.ProfilingAspect    : Execution time in class com.maystrovyy.HelloWorld method: sayHello = n milliseconds.

If the method was executed less than 10 seconds - the calculation will be in milliseconds, in all other cases - in seconds.