Timeron

a simple framework for measuring method call performance

License

License

GroupId

GroupId

com.github.lkq
ArtifactId

ArtifactId

timeron
Last Version

Last Version

0.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

Timeron
a simple framework for measuring method call performance
Project URL

Project URL

https://github.com/lkq/timeron
Source Code Management

Source Code Management

https://github.com/lkq/timeron

Download timeron

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.lkq/timeron/ -->
<dependency>
    <groupId>com.github.lkq</groupId>
    <artifactId>timeron</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.lkq/timeron/
implementation 'com.github.lkq:timeron:0.3.1'
// https://jarcasting.com/artifacts/com.github.lkq/timeron/
implementation ("com.github.lkq:timeron:0.3.1")
'com.github.lkq:timeron:jar:0.3.1'
<dependency org="com.github.lkq" name="timeron" rev="0.3.1">
  <artifact name="timeron" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.lkq', module='timeron', version='0.3.1')
)
libraryDependencies += "com.github.lkq" % "timeron" % "0.3.1"
[com.github.lkq/timeron "0.3.1"]

Dependencies

test (4)

Group / Artifact Type Version
org.skyscreamer : jsonassert jar 1.5.0
org.junit.jupiter : junit-jupiter-api jar 5.1.0
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

Timer On

Build Status

A simple framework for measuring performance of method call using AOP

Usage

available in maven central

add dependency

<dependency>
    <groupId>com.github.lkq</groupId>
    <artifactId>timeron</artifactId>
    <version>0.3.1</version>
</dependency>

setup

public interface UserService {
    User getUser(String name);
}
public class UserServiceImpl implements UserService {
    public User getUser(String name) {
     //...
    }
}

// setup measurement
Timer timer = new Timer();
UserSerivce interceptor = timer.interceptor(UserSerivce.class)
timer.measure(() -> interceptor.getUser(""));

UserService userService = timer.on(new UserServiceImpl())

// business logic
userService.getUser("kingson");

results

String result = timer.getStats()

// value of "result"
[{"com.github.lkq.timeron.UserServiceImpl.getUser(String)": {
    "total": 947396,
    "count": 100,
    "avg": 9473
}}]

more sample usage could be found in here

TODO List

  • support void methods
  • add benchmark tests
  • detach the measurement handling logic from the calling thread
  • redesign result formatting
  • support generic method
  • allow adding callback to listen on measurement event

Versions

Version
0.3.1