Class NullTracer

java.lang.Object
org.pipservices3.components.trace.NullTracer
All Implemented Interfaces:
ITracer

public class NullTracer extends Object implements ITracer
Dummy implementation of tracer that doesn't do anything.

It can be used in testing or in situations when tracing is required but shall be disabled.

See Also:
  • Constructor Details

    • NullTracer

      public NullTracer()
  • Method Details

    • trace

      public void trace(String correlationId, String component, String operation, Long duration)
      Records an operation trace with its name and duration
      Specified by:
      trace in interface ITracer
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      component - a name of called component
      operation - a name of the executed operation.
      duration - execution duration in milliseconds.
    • failure

      public void failure(String correlationId, String component, String operation, Exception error, long duration)
      Records an operation failure with its name, duration and error
      Specified by:
      failure in interface ITracer
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      component - a name of called component
      operation - a name of the executed operation.
      error - an error object associated with this trace.
      duration - execution duration in milliseconds.
    • beginTrace

      public TraceTiming beginTrace(String correlationId, String component, String operation)
      Begings recording an operation trace
      Specified by:
      beginTrace in interface ITracer
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      component - a name of called component
      operation - a name of the executed operation.
      Returns:
      a trace timing object.