Class PlainTracer

java.lang.Object
overit.geocall.util.tracer.MemoryTracer
overit.geocall.util.tracer.PlainTracer
All Implemented Interfaces:
Serializable, Tracer

public class PlainTracer extends MemoryTracer implements Serializable
This class extends the abstract class MemoryTracer and creates an instance of the tracer.
This tracer put in the register the first 'n' rows, where 'n' is the value of the parameter passed to the constructor PlainTracer(maxSize).
Usually the 'maxSize' corresponds to the value ThreadContext.MAX_MEMORY_TRACE_SIZE.
See Also:
  • Field Details

    • _registry

      protected ArrayList _registry
    • _lines

      protected int _lines
  • Constructor Details

    • PlainTracer

      public PlainTracer(int maxSize)
      Class constructor using the first parameter to determine the maximum registry length.
      Parameters:
      maxSize - Maximum registry length.
  • Method Details

    • getRegistry

      public ArrayList getRegistry()
      Return the ArrayList called "registry" containing all the records of the log.
      Specified by:
      getRegistry in class MemoryTracer
      Returns:
      The ArrayList contains all the records of the log.
    • record

      public void record(String name, Object val)
      Adds a record of log to the registry. If the registry is full, the record will not be added and the last row contains the name "TRACE SPACE FULL" and the value empty.
      Specified by:
      record in interface Tracer
      Parameters:
      name - String contains the name of the record to put in the registry.
      val - The value to put in the registry.
    • stop

      public void stop()
      Method to call when the execution is finished. Takes care of calculating the execution time as a delta between the start and end processing time.
      Specified by:
      stop in interface Tracer
    • getTraceTime

      public long getTraceTime()
      Return the time of the execution. If the stop() has not been called, the value returned will be 0.
      Specified by:
      getTraceTime in interface Tracer
      Returns:
      The time of the execution.