public class Tracer extends Object
Before calling a method in your program, call Tracer.signal():
Tracer.signal("Calling blah");
In your main method, state
Tracer.start(number of milliseconds);
Whenever the tracer does not receive a signal for the given number of milliseconds,
it writes a warning, such as e.g.
Calling blah hangs
When it receives the next signal, it will say
Hang resolved
Use the tracer for debugging purposes only.| Modifier and Type | Class and Description |
|---|---|
protected static class |
Tracer.TracerThread
The thread itself
|
| Modifier and Type | Field and Description |
|---|---|
protected static Tracer.TracerThread |
tracer
Internal trace thread
|
| Constructor and Description |
|---|
Tracer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Calls test1 and test2 in a loop.
|
static boolean |
signal(Object... s)
Send a signal to the tracer.
|
static boolean |
start(long millisDelay)
Start the tracer, accept millisDelay milliseconds between two signals before issuing a warning.
|
static void |
stop()
Stop the tracer
|
static void |
test1()
Sleeps for 2 seconds.
|
static void |
test2()
Sleeps for 5 seconds.
|
protected static Tracer.TracerThread tracer
public static boolean start(long millisDelay)
public static void stop()
public static boolean signal(Object... s)
public static void test1()
public static void test2()
public static void main(String[] args)
Copyright © 2018. All rights reserved.