Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 1.45 KB

README.md

File metadata and controls

70 lines (49 loc) · 1.45 KB

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
    }
}