com.dynatrace.oneagent.sdk.api
Interface Tracer

All Known Subinterfaces:
CustomServiceTracer, DatabaseRequestTracer, IncomingMessageProcessTracer, IncomingMessageReceiveTracer, IncomingRemoteCallTracer, IncomingWebRequestTracer, InProcessLinkTracer, OutgoingMessageTracer, OutgoingRemoteCallTracer, OutgoingWebRequestTracer

public interface Tracer

Common interface for timing-related methods. Not to be directly used by SDK user.


Method Summary
 void end()
          Ends timing of a node.
 void error(java.lang.String message)
          Marks the node as 'exited by exception'.
 void error(java.lang.Throwable throwable)
          Marks the node as 'exited by exception'.Additional information can be provided as Throwable.
 void start()
          starts timing of a node.
 

Method Detail

start

void start()
starts timing of a node. Every node that has been started, must be ended with end() method. Consider using the following pattern:
 tracer.start();
   try {
     // do your work
   } catch (Exception e) {
     tracer.error(e);
   } finally {
     tracer.end();
   }
 
 
start(), end(), error(String), error(Throwable) are not thread-safe. They must be called from the same thread where start() has been invoked.

Since:
1.0

end

void end()
Ends timing of a node. Typically this method is called via finally block.
start(), end(), error(String), error(Throwable) are not thread-safe. They must be called from the same thread where start() has been invoked.

Since:
1.0

error

void error(java.lang.String message)
Marks the node as 'exited by exception'. An additional error message can be provided as String.
start(), end(), error(String), error(Throwable) are not thread-safe. They must be called from the same thread where start() has been invoked.

Parameters:
message - error message with details about occurred error (eg. return code). must not be null.
Since:
1.0

error

void error(java.lang.Throwable throwable)
Marks the node as 'exited by exception'.Additional information can be provided as Throwable.
start(), end(), error(String), error(Throwable) are not thread-safe. They must be called from the same thread where start() has been invoked.

Parameters:
throwable - exception, that occurred. must not null.
Since:
1.0