Timeron

a simple framework for measuring method call performance

Лицензия

Лицензия

Группа

Группа

com.github.lkq
Идентификатор

Идентификатор

timeron
Последняя версия

Последняя версия

0.3.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Timeron
a simple framework for measuring method call performance
Ссылка на сайт

Ссылка на сайт

https://github.com/lkq/timeron
Система контроля версий

Система контроля версий

https://github.com/lkq/timeron

Скачать timeron

Как подключить последнюю версию

<!-- 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"]

Зависимости

test (4)

Идентификатор библиотеки Тип Версия
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

Модули Проекта

Данный проект не имеет модулей.

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

Версии библиотеки

Версия
0.3.1