Skip to content

Java library to log the execution time of your methods in Spring Boot components

License

Notifications You must be signed in to change notification settings

dario-mr/time-it

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time It!

Lightweight yet comprehensive library to log the execution time of your methods in Spring Boot components.

Relies on slf4j for logging.

Requirements

Installation

Maven Central

Get the latest version from Maven Central.

<dependency>
    <groupId>io.github.dario-mr</groupId>
    <artifactId>time-it</artifactId>
    <version>${latestVersion}</version>
</dependency>

JAR

Get the latest JAR from Github Packages, or generate your own with the maven command:

mvn package

Usage

@Service
public class MyService {

    @TimeIt
    public void myMethod() {
        // my code
    }
}

Configuration

@TimeIt can be configured at annotation level via the properties:

  • unit (default MILLISECONDS)
  • logLevel (default INFO)
@Service
public class MyService {

    @TimeIt(unit = TimeUnit.SECONDS, logLevel = Level.WARN)
    public void myMethod() {
        // my code
    }
}

About

Java library to log the execution time of your methods in Spring Boot components

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages