Package overit.geocall.util.tracer
Class MemoryTracer
java.lang.Object
overit.geocall.util.tracer.MemoryTracer
- All Implemented Interfaces:
Serializable,Tracer
- Direct Known Subclasses:
PlainTracer,StartEndTracer
Abstract class to extend to create a tracer. When you extends the class the method
to be implemented is
getRegistry(). The static method that chooses which instance
of tracer to create is makeTracer().- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ArrayListMethod to implement in the classes that extend theMemoryTracer.static MemoryTracermakeTracer(String type, int maxSize) The static method that chooses which instance of tracer must be created.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.util.Tracer
getTraceTime, record, stop
-
Field Details
-
_maxSize
protected int _maxSize -
_time
protected long _timeIf it is less than 0, the data of start is recorded, otherwise the delta.
-
-
Constructor Details
-
MemoryTracer
public MemoryTracer()
-
-
Method Details
-
makeTracer
The static method that chooses which instance of tracer must be created.
The default instantiated tracer isStartEndTracerbut if the second parameter is set with the string"plain"(it is not case sensitive), the instantiated tracer will bePlainTracer.- Parameters:
type- Type of tracer. If it isnullthe instantiated tracer will beStartEndTracer; if it is"plain", the tracer will bePlainTracer.maxSize- Number maximum of the rows to print.- Returns:
- The instance of the tracer.
-
getRegistry
Method to implement in the classes that extend theMemoryTracer. This must return theArrayListwith all the records of the log.- Returns:
- The
ArrayListcontains all the records of the log.
-