Preface
Ulyp is a proof-of-concept tracing instrumentation agent which records an execution of desired methods and sends them to UI. The agent should be provided only with two parameters: packages in which classes should be instrumented and a strating point in the following format: (simple class name).(method name). The starting point may be Runnable.run
or it may contain a wildcard, like: UserDao.*
.
The main purpose is mostly research of frameworks and troubleshooting of heavy enterprise applications where frameworks like Hibernate or Spring may call thousands of methods. Please note, the agent has very high performance impact and it's very intrusive.
Usage
Ulyp is bundled with very simple desktop UI written on JavaFX and agent itself.
Agent has the following props which are set as java system properties (via -Dkey=value
)
Property | Mandatory | Default value | Example | Description |
---|---|---|---|---|
ulyp.ui-host | No | localhost | localhost | Target host for UI connection |
ulyp.ui-port | No | 13991 | 13991 | Target port for UI connection |
ulyp.max-depth | No | Integer.MAX_VALUE | 20 | Max depth of call trace tree. May be useful for limiting instrumentation data |
ulyp.ui-port | No | 13991 | 13991 | Target port for UI connection |
ulyp.log | No | - | Used as -Dulyp.log | Turns on agent logging |
Example of running java app with the agent:
java -javaagent:C:\Work\Tools\ulyp-agent-0.1\ulyp-agent-0.1.jar -Dulyp.packages=com.demo,org.hibernate,org.h2 -Dulyp.start-method=JpaProxyUserRepositoryIntegrationTest.sampleTestCase YourClassName
Build
./gradlew clean build test
Simplest example: Fibbonaci numbers
package com.example;
public class FibbonaciTest {
@Test
public void test() {
Assert.assertEquals(13, compute(7));
}
public static int compute(int n) {
if (n <= 1)
return n;
return compute(n - 1) + compute(n - 2);
}
}
In order to activate ulyp the test should be executed with the following additional VM key:
-javaagent:C:\Work\ulyp\ulyp-agent\build\libs\ulyp-agent-0.2.jar
Specify "com" package to be instrumented and "FibbonaciTest.test" as tracing start method in UI and run the test:
Example (hibernate + h2 database)
Simple hibernate test recording:
@Autowired
private JpaProxyUserRepository repository;
@Test
public void sampleTestCase() {
User dave = new User("Dave", "Mathews");
dave = repository.save(dave);
}
The whole method traces tree may be investigated in the UI: